home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / Developer Essentials Jul 90 / DTS Sample Code / Macintosh Sample Code / Monthly Releases (Compressed) / MacDTS.Sample.Code.89.06.sit / SC.002.TESample / TESample.c < prev    next >
MacBinary  |  1989-06-01  |  51.6 KB  |  [TEXT/MPS ]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Thu Jun 1 15:57:01 1989, modified Thu Jun 1 15:57:01 1989, creator 'MPS ', type ASCII, 52305 bytes "TESample.c" , at 0xccd1 382 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MPS ]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0a 54 45 53 61 6d 70 | 6c 65 2e 63 00 00 00 00 |..TESamp|le.c....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 00 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 cc 51 00 | 00 01 7e a0 ab 45 8d a0 |......Q.|..~..E..|
|00000060| ab 45 8d 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.E......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 b0 02 00 00 |........|........|
|00000080| 2f 2a 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |/*------|--------|
|00000090| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000d0| 0d 23 0d 23 09 41 70 70 | 6c 65 20 4d 61 63 69 6e |.#.#.App|le Macin|
|000000e0| 74 6f 73 68 20 44 65 76 | 65 6c 6f 70 65 72 20 54 |tosh Dev|eloper T|
|000000f0| 65 63 68 6e 69 63 61 6c | 20 53 75 70 70 6f 72 74 |echnical| Support|
|00000100| 0d 23 0d 23 09 4d 75 6c | 74 69 46 69 6e 64 65 72 |.#.#.Mul|tiFinder|
|00000110| 2d 41 77 61 72 65 20 53 | 69 6d 70 6c 65 20 54 65 |-Aware S|imple Te|
|00000120| 78 74 45 64 69 74 20 53 | 61 6d 70 6c 65 20 41 70 |xtEdit S|ample Ap|
|00000130| 70 6c 69 63 61 74 69 6f | 6e 0d 23 0d 23 09 54 45 |plicatio|n.#.#.TE|
|00000140| 53 61 6d 70 6c 65 0d 23 | 0d 23 09 54 68 69 73 20 |Sample.#|.#.This |
|00000150| 66 69 6c 65 3a 20 54 45 | 53 61 6d 70 6c 65 2e 63 |file: TE|Sample.c|
|00000160| 09 2d 09 43 20 53 6f 75 | 72 63 65 0d 23 0d 23 09 |.-.C Sou|rce.#.#.|
|00000170| 43 6f 70 79 72 69 67 68 | 74 20 a9 20 31 39 38 39 |Copyrigh|t . 1989|
|00000180| 20 41 70 70 6c 65 20 43 | 6f 6d 70 75 74 65 72 2c | Apple C|omputer,|
|00000190| 20 49 6e 63 2e 0d 23 09 | 41 6c 6c 20 72 69 67 68 | Inc..#.|All righ|
|000001a0| 74 73 20 72 65 73 65 72 | 76 65 64 2e 0d 23 0d 23 |ts reser|ved..#.#|
|000001b0| 09 56 65 72 73 69 6f 6e | 73 3a 09 0d 23 09 09 09 |.Version|s:..#...|
|000001c0| 09 31 2e 30 30 09 09 09 | 09 30 38 2f 38 38 0d 23 |.1.00...|.08/88.#|
|000001d0| 09 09 09 09 31 2e 30 31 | 09 09 09 09 31 31 2f 38 |....1.01|....11/8|
|000001e0| 38 0d 23 09 09 09 09 31 | 2e 30 32 09 09 09 09 30 |8.#....1|.02....0|
|000001f0| 34 2f 38 39 0d 23 09 09 | 09 09 31 2e 30 33 09 09 |4/89.#..|..1.03..|
|00000200| 09 09 30 36 2f 38 39 0d | 23 0d 23 09 43 6f 6d 70 |..06/89.|#.#.Comp|
|00000210| 6f 6e 65 6e 74 73 3a 0d | 23 09 09 09 09 54 45 53 |onents:.|#....TES|
|00000220| 61 6d 70 6c 65 2e 70 09 | 09 09 4a 75 6e 65 20 31 |ample.p.|..June 1|
|00000230| 2c 20 31 39 38 39 0d 23 | 09 09 09 09 54 45 53 61 |, 1989.#|....TESa|
|00000240| 6d 70 6c 65 2e 63 09 09 | 09 4a 75 6e 65 20 31 2c |mple.c..|.June 1,|
|00000250| 20 31 39 38 39 0d 23 09 | 09 09 09 54 45 53 61 6d | 1989.#.|...TESam|
|00000260| 70 6c 65 47 6c 75 65 2e | 61 09 09 4a 75 6e 65 20 |pleGlue.|a..June |
|00000270| 31 2c 20 31 39 38 39 09 | 2d 4d 50 57 20 6f 6e 6c |1, 1989.|-MPW onl|
|00000280| 79 2d 0d 23 09 09 09 09 | 54 45 53 61 6d 70 6c 65 |y-.#....|TESample|
|00000290| 2e 72 09 09 09 4a 75 6e | 65 20 31 2c 20 31 39 38 |.r...Jun|e 1, 198|
|000002a0| 39 0d 23 09 09 09 09 54 | 45 53 61 6d 70 6c 65 2e |9.#....T|ESample.|
|000002b0| 68 09 09 09 4a 75 6e 65 | 20 31 2c 20 31 39 38 39 |h...June| 1, 1989|
|000002c0| 0d 23 09 09 09 09 50 54 | 45 53 61 6d 70 6c 65 2e |.#....PT|ESample.|
|000002d0| 6d 61 6b 65 09 09 4a 75 | 6e 65 20 31 2c 20 31 39 |make..Ju|ne 1, 19|
|000002e0| 38 39 09 2d 4d 50 57 20 | 6f 6e 6c 79 2d 0d 23 09 |89.-MPW |only-.#.|
|000002f0| 09 09 09 43 54 45 53 61 | 6d 70 6c 65 2e 6d 61 6b |...CTESa|mple.mak|
|00000300| 65 09 09 4a 75 6e 65 20 | 31 2c 20 31 39 38 39 09 |e..June |1, 1989.|
|00000310| 2d 4d 50 57 20 6f 6e 6c | 79 2d 0d 23 09 09 09 09 |-MPW onl|y-.#....|
|00000320| 54 45 53 61 6d 70 6c 65 | 47 6c 75 65 2e 73 09 09 |TESample|Glue.s..|
|00000330| 4a 75 6e 65 20 31 2c 20 | 31 39 38 39 09 2d 41 2f |June 1, |1989.-A/|
|00000340| 55 58 20 6f 6e 6c 79 2d | 0d 23 09 09 09 09 54 45 |UX only-|.#....TE|
|00000350| 53 61 6d 70 6c 65 41 55 | 58 2e 72 09 09 4a 75 6e |SampleAU|X.r..Jun|
|00000360| 65 20 31 2c 20 31 39 38 | 39 09 2d 41 2f 55 58 20 |e 1, 198|9.-A/UX |
|00000370| 6f 6e 6c 79 2d 0d 23 09 | 09 09 09 4d 61 6b 65 66 |only-.#.|...Makef|
|00000380| 69 6c 65 09 09 09 4a 75 | 6e 65 20 31 2c 20 31 39 |ile...Ju|ne 1, 19|
|00000390| 38 39 09 2d 41 2f 55 58 | 20 6f 6e 6c 79 2d 0d 23 |89.-A/UX| only-.#|
|000003a0| 0d 23 09 54 45 53 61 6d | 70 6c 65 20 69 73 20 61 |.#.TESam|ple is a|
|000003b0| 6e 20 65 78 61 6d 70 6c | 65 20 61 70 70 6c 69 63 |n exampl|e applic|
|000003c0| 61 74 69 6f 6e 20 74 68 | 61 74 20 64 65 6d 6f 6e |ation th|at demon|
|000003d0| 73 74 72 61 74 65 73 20 | 68 6f 77 20 0d 23 09 74 |strates |how .#.t|
|000003e0| 6f 20 69 6e 69 74 69 61 | 6c 69 7a 65 20 74 68 65 |o initia|lize the|
|000003f0| 20 63 6f 6d 6d 6f 6e 6c | 79 20 75 73 65 64 20 74 | commonl|y used t|
|00000400| 6f 6f 6c 62 6f 78 20 6d | 61 6e 61 67 65 72 73 2c |oolbox m|anagers,|
|00000410| 20 6f 70 65 72 61 74 65 | 20 0d 23 09 73 75 63 63 | operate| .#.succ|
|00000420| 65 73 73 66 75 6c 6c 79 | 20 75 6e 64 65 72 20 4d |essfully| under M|
|00000430| 75 6c 74 69 46 69 6e 64 | 65 72 2c 20 68 61 6e 64 |ultiFind|er, hand|
|00000440| 6c 65 20 64 65 73 6b 20 | 61 63 63 65 73 73 6f 72 |le desk |accessor|
|00000450| 69 65 73 20 61 6e 64 20 | 0d 23 09 63 72 65 61 74 |ies and |.#.creat|
|00000460| 65 2c 20 67 72 6f 77 2c | 20 61 6e 64 20 7a 6f 6f |e, grow,| and zoo|
|00000470| 6d 20 77 69 6e 64 6f 77 | 73 2e 20 54 68 65 20 66 |m window|s. The f|
|00000480| 75 6e 64 61 6d 65 6e 74 | 61 6c 20 54 65 78 74 45 |undament|al TextE|
|00000490| 64 69 74 20 0d 23 09 74 | 6f 6f 6c 62 6f 78 20 63 |dit .#.t|oolbox c|
|000004a0| 61 6c 6c 73 20 61 6e 64 | 20 54 65 78 74 45 64 69 |alls and| TextEdi|
|000004b0| 74 20 61 75 74 6f 73 63 | 72 6f 6c 6c 20 61 72 65 |t autosc|roll are|
|000004c0| 20 64 65 6d 6f 6e 73 74 | 72 61 74 65 64 2e 20 49 | demonst|rated. I|
|000004d0| 74 20 0d 23 09 61 6c 73 | 6f 20 73 68 6f 77 73 20 |t .#.als|o shows |
|000004e0| 68 6f 77 20 74 6f 20 63 | 72 65 61 74 65 20 61 6e |how to c|reate an|
|000004f0| 64 20 6d 61 69 6e 74 61 | 69 6e 20 73 63 72 6f 6c |d mainta|in scrol|
|00000500| 6c 62 61 72 20 63 6f 6e | 74 72 6f 6c 73 2e 0d 23 |lbar con|trols..#|
|00000510| 0d 23 09 49 74 20 64 6f | 65 73 20 6e 6f 74 20 62 |.#.It do|es not b|
|00000520| 79 20 61 6e 79 20 6d 65 | 61 6e 73 20 64 65 6d 6f |y any me|ans demo|
|00000530| 6e 73 74 72 61 74 65 20 | 61 6c 6c 20 74 68 65 20 |nstrate |all the |
|00000540| 74 65 63 68 6e 69 71 75 | 65 73 20 79 6f 75 20 0d |techniqu|es you .|
|00000550| 23 09 6e 65 65 64 20 66 | 6f 72 20 61 20 6c 61 72 |#.need f|or a lar|
|00000560| 67 65 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 2e 20 |ge appli|cation. |
|00000570| 49 6e 20 70 61 72 74 69 | 63 75 6c 61 72 2c 20 53 |In parti|cular, S|
|00000580| 61 6d 70 6c 65 20 64 6f | 65 73 20 6e 6f 74 20 0d |ample do|es not .|
|00000590| 23 09 63 6f 76 65 72 20 | 65 78 63 65 70 74 69 6f |#.cover |exceptio|
|000005a0| 6e 20 68 61 6e 64 6c 69 | 6e 67 2c 20 6d 75 6c 74 |n handli|ng, mult|
|000005b0| 69 70 6c 65 20 77 69 6e | 64 6f 77 73 2f 64 6f 63 |iple win|dows/doc|
|000005c0| 75 6d 65 6e 74 73 2c 20 | 0d 23 09 73 6f 70 68 69 |uments, |.#.sophi|
|000005d0| 73 74 69 63 61 74 65 64 | 20 6d 65 6d 6f 72 79 20 |sticated| memory |
|000005e0| 6d 61 6e 61 67 65 6d 65 | 6e 74 2c 20 70 72 69 6e |manageme|nt, prin|
|000005f0| 74 69 6e 67 2c 20 6f 72 | 20 75 6e 64 6f 2e 20 41 |ting, or| undo. A|
|00000600| 6c 6c 20 6f 66 20 0d 23 | 09 74 68 65 73 65 20 61 |ll of .#|.these a|
|00000610| 72 65 20 76 69 74 61 6c | 20 70 61 72 74 73 20 6f |re vital| parts o|
|00000620| 66 20 61 20 6e 6f 72 6d | 61 6c 20 66 75 6c 6c 2d |f a norm|al full-|
|00000630| 73 69 7a 65 64 20 61 70 | 70 6c 69 63 61 74 69 6f |sized ap|plicatio|
|00000640| 6e 2e 0d 23 0d 23 09 54 | 68 69 73 20 61 70 70 6c |n..#.#.T|his appl|
|00000650| 69 63 61 74 69 6f 6e 20 | 69 73 20 61 6e 20 65 78 |ication |is an ex|
|00000660| 61 6d 70 6c 65 20 6f 66 | 20 74 68 65 20 66 6f 72 |ample of| the for|
|00000670| 6d 20 6f 66 20 61 20 4d | 61 63 69 6e 74 6f 73 68 |m of a M|acintosh|
|00000680| 20 0d 23 09 61 70 70 6c | 69 63 61 74 69 6f 6e 3b | .#.appl|ication;|
|00000690| 20 69 74 20 69 73 20 4e | 4f 54 20 61 20 74 65 6d | it is N|OT a tem|
|000006a0| 70 6c 61 74 65 2e 20 49 | 74 20 69 73 20 4e 4f 54 |plate. I|t is NOT|
|000006b0| 20 69 6e 74 65 6e 64 65 | 64 20 74 6f 20 62 65 20 | intende|d to be |
|000006c0| 0d 23 09 75 73 65 64 20 | 61 73 20 61 20 66 6f 75 |.#.used |as a fou|
|000006d0| 6e 64 61 74 69 6f 6e 20 | 66 6f 72 20 74 68 65 20 |ndation |for the |
|000006e0| 6e 65 78 74 20 77 6f 72 | 6c 64 2d 63 6c 61 73 73 |next wor|ld-class|
|000006f0| 2c 20 62 65 73 74 2d 73 | 65 6c 6c 69 6e 67 2c 20 |, best-s|elling, |
|00000700| 0d 23 09 36 30 30 4b 20 | 61 70 70 6c 69 63 61 74 |.#.600K |applicat|
|00000710| 69 6f 6e 2e 20 41 20 73 | 74 69 63 6b 20 66 69 67 |ion. A s|tick fig|
|00000720| 75 72 65 20 64 72 61 77 | 69 6e 67 20 6f 66 20 74 |ure draw|ing of t|
|00000730| 68 65 20 68 75 6d 61 6e | 20 62 6f 64 79 20 6d 61 |he human| body ma|
|00000740| 79 20 0d 23 09 62 65 20 | 61 20 67 6f 6f 64 20 65 |y .#.be |a good e|
|00000750| 78 61 6d 70 6c 65 20 6f | 66 20 74 68 65 20 66 6f |xample o|f the fo|
|00000760| 72 6d 20 66 6f 72 20 61 | 20 70 61 69 6e 74 69 6e |rm for a| paintin|
|00000770| 67 2c 20 62 75 74 20 74 | 68 61 74 20 64 6f 65 73 |g, but t|hat does|
|00000780| 20 6e 6f 74 20 0d 23 09 | 6d 65 61 6e 20 69 74 20 | not .#.|mean it |
|00000790| 73 68 6f 75 6c 64 20 62 | 65 20 75 73 65 64 20 61 |should b|e used a|
|000007a0| 73 20 74 68 65 20 62 61 | 73 69 73 20 66 6f 72 20 |s the ba|sis for |
|000007b0| 74 68 65 20 6e 65 78 74 | 20 4d 6f 6e 61 20 4c 69 |the next| Mona Li|
|000007c0| 73 61 2e 0d 23 0d 23 09 | 57 65 20 72 65 63 6f 6d |sa..#.#.|We recom|
|000007d0| 6d 65 6e 64 20 74 68 61 | 74 20 79 6f 75 20 72 65 |mend tha|t you re|
|000007e0| 76 69 65 77 20 74 68 69 | 73 20 70 72 6f 67 72 61 |view thi|s progra|
|000007f0| 6d 20 6f 72 20 53 61 6d | 70 6c 65 20 62 65 66 6f |m or Sam|ple befo|
|00000800| 72 65 20 0d 23 09 62 65 | 67 69 6e 6e 69 6e 67 20 |re .#.be|ginning |
|00000810| 61 20 6e 65 77 20 61 70 | 70 6c 69 63 61 74 69 6f |a new ap|plicatio|
|00000820| 6e 2e 20 53 61 6d 70 6c | 65 20 69 73 20 61 20 73 |n. Sampl|e is a s|
|00000830| 69 6d 70 6c 65 20 61 70 | 70 2e 20 77 68 69 63 68 |imple ap|p. which|
|00000840| 20 64 6f 65 73 6e d5 74 | 20 0d 23 09 75 73 65 20 | doesn.t| .#.use |
|00000850| 54 65 78 74 45 64 69 74 | 20 6f 72 20 74 68 65 20 |TextEdit| or the |
|00000860| 43 6f 6e 74 72 6f 6c 20 | 4d 61 6e 61 67 65 72 2e |Control |Manager.|
|00000870| 0d 23 0d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |.#.-----|--------|
|00000880| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000890| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000008a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000008b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000008c0| 2d 2a 2f 0d 0d 0d 2f 2a | 20 53 65 67 6d 65 6e 74 |-*/.../*| Segment|
|000008d0| 61 74 69 6f 6e 20 73 74 | 72 61 74 65 67 79 3a 0d |ation st|rategy:.|
|000008e0| 0d 20 20 20 54 68 69 73 | 20 70 72 6f 67 72 61 6d |. This| program|
|000008f0| 20 63 6f 6e 73 69 73 74 | 73 20 6f 66 20 74 68 72 | consist|s of thr|
|00000900| 65 65 20 73 65 67 6d 65 | 6e 74 73 2e 20 4d 61 69 |ee segme|nts. Mai|
|00000910| 6e 20 63 6f 6e 74 61 69 | 6e 73 20 6d 6f 73 74 20 |n contai|ns most |
|00000920| 6f 66 20 74 68 65 20 63 | 6f 64 65 2c 0d 20 20 20 |of the c|ode,. |
|00000930| 69 6e 63 6c 75 64 69 6e | 67 20 74 68 65 20 4d 50 |includin|g the MP|
|00000940| 57 20 6c 69 62 72 61 72 | 69 65 73 2c 20 61 6e 64 |W librar|ies, and|
|00000950| 20 74 68 65 20 6d 61 69 | 6e 20 70 72 6f 67 72 61 | the mai|n progra|
|00000960| 6d 2e 20 49 6e 69 74 69 | 61 6c 69 7a 65 20 63 6f |m. Initi|alize co|
|00000970| 6e 74 61 69 6e 73 0d 20 | 20 20 63 6f 64 65 20 74 |ntains. | code t|
|00000980| 68 61 74 20 69 73 20 6f | 6e 6c 79 20 75 73 65 64 |hat is o|nly used|
|00000990| 20 6f 6e 63 65 2c 20 64 | 75 72 69 6e 67 20 73 74 | once, d|uring st|
|000009a0| 61 72 74 75 70 2c 20 61 | 6e 64 20 63 61 6e 20 62 |artup, a|nd can b|
|000009b0| 65 20 75 6e 6c 6f 61 64 | 65 64 20 61 66 74 65 72 |e unload|ed after|
|000009c0| 20 74 68 65 0d 20 20 20 | 70 72 6f 67 72 61 6d 20 | the. |program |
|000009d0| 73 74 61 72 74 73 2e 20 | 25 41 35 49 6e 69 74 20 |starts. |%A5Init |
|000009e0| 69 73 20 61 75 74 6f 6d | 61 74 69 63 61 6c 6c 79 |is autom|atically|
|000009f0| 20 63 72 65 61 74 65 64 | 20 62 79 20 74 68 65 20 | created| by the |
|00000a00| 4c 69 6e 6b 65 72 20 74 | 6f 20 69 6e 69 74 69 61 |Linker t|o initia|
|00000a10| 6c 69 7a 65 0d 20 20 20 | 67 6c 6f 62 61 6c 73 20 |lize. |globals |
|00000a20| 66 6f 72 20 74 68 65 20 | 4d 50 57 20 6c 69 62 72 |for the |MPW libr|
|00000a30| 61 72 69 65 73 20 61 6e | 64 20 69 73 20 75 6e 6c |aries an|d is unl|
|00000a40| 6f 61 64 65 64 20 72 69 | 67 68 74 20 61 77 61 79 |oaded ri|ght away|
|00000a50| 2e 20 2a 2f 0d 0d 0d 2f | 2a 20 53 65 74 50 6f 72 |. */.../|* SetPor|
|00000a60| 74 20 73 74 72 61 74 65 | 67 79 3a 0d 0d 20 20 20 |t strate|gy:.. |
|00000a70| 54 6f 6f 6c 62 6f 78 20 | 72 6f 75 74 69 6e 65 73 |Toolbox |routines|
|00000a80| 20 64 6f 20 6e 6f 74 20 | 63 68 61 6e 67 65 20 74 | do not |change t|
|00000a90| 68 65 20 63 75 72 72 65 | 6e 74 20 70 6f 72 74 2e |he curre|nt port.|
|00000aa0| 20 49 6e 20 73 70 69 74 | 65 20 6f 66 20 74 68 69 | In spit|e of thi|
|00000ab0| 73 2c 20 69 6e 20 74 68 | 69 73 0d 20 20 20 70 72 |s, in th|is. pr|
|00000ac0| 6f 67 72 61 6d 20 77 65 | 20 75 73 65 20 61 20 73 |ogram we| use a s|
|00000ad0| 74 72 61 74 65 67 79 20 | 6f 66 20 63 61 6c 6c 69 |trategy |of calli|
|00000ae0| 6e 67 20 53 65 74 50 6f | 72 74 20 77 68 65 6e 65 |ng SetPo|rt whene|
|00000af0| 76 65 72 20 77 65 20 77 | 61 6e 74 20 74 6f 20 64 |ver we w|ant to d|
|00000b00| 72 61 77 20 6f 72 0d 20 | 20 20 6d 61 6b 65 20 63 |raw or. | make c|
|00000b10| 61 6c 6c 73 20 77 68 69 | 63 68 20 64 65 70 65 6e |alls whi|ch depen|
|00000b20| 64 20 6f 6e 20 74 68 65 | 20 63 75 72 72 65 6e 74 |d on the| current|
|00000b30| 20 70 6f 72 74 2e 20 54 | 68 69 73 20 6d 61 6b 65 | port. T|his make|
|00000b40| 73 20 75 73 20 6c 65 73 | 73 20 76 75 6c 6e 65 72 |s us les|s vulner|
|00000b50| 61 62 6c 65 0d 20 20 20 | 74 6f 20 62 75 67 73 20 |able. |to bugs |
|00000b60| 69 6e 20 6f 74 68 65 72 | 20 73 6f 66 74 77 61 72 |in other| softwar|
|00000b70| 65 20 77 68 69 63 68 20 | 6d 69 67 68 74 20 61 6c |e which |might al|
|00000b80| 74 65 72 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 |ter the |current |
|00000b90| 70 6f 72 74 20 28 73 75 | 63 68 20 61 73 20 74 68 |port (su|ch as th|
|00000ba0| 65 0d 20 20 20 62 75 67 | 20 28 66 65 61 74 75 72 |e. bug| (featur|
|00000bb0| 65 3f 29 20 69 6e 20 6d | 61 6e 79 20 64 65 73 6b |e?) in m|any desk|
|00000bc0| 20 61 63 63 65 73 73 6f | 72 69 65 73 20 77 68 69 | accesso|ries whi|
|00000bd0| 63 68 20 63 68 61 6e 67 | 65 20 74 68 65 20 70 6f |ch chang|e the po|
|00000be0| 72 74 20 6f 6e 20 4f 70 | 65 6e 44 65 73 6b 41 63 |rt on Op|enDeskAc|
|00000bf0| 63 29 2e 0d 20 20 20 48 | 6f 70 65 66 75 6c 6c 79 |c).. H|opefully|
|00000c00| 2c 20 74 68 69 73 20 61 | 6c 73 6f 20 6d 61 6b 65 |, this a|lso make|
|00000c10| 73 20 74 68 65 20 72 6f | 75 74 69 6e 65 73 20 66 |s the ro|utines f|
|00000c20| 72 6f 6d 20 74 68 69 73 | 20 70 72 6f 67 72 61 6d |rom this| program|
|00000c30| 20 6d 6f 72 65 20 73 65 | 6c 66 2d 63 6f 6e 74 61 | more se|lf-conta|
|00000c40| 69 6e 65 64 2c 0d 20 20 | 20 73 69 6e 63 65 20 74 |ined,. | since t|
|00000c50| 68 65 79 20 64 6f 6e 27 | 74 20 64 65 70 65 6e 64 |hey don'|t depend|
|00000c60| 20 6f 6e 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 | on the |current |
|00000c70| 70 6f 72 74 20 73 65 74 | 74 69 6e 67 2e 20 2a 2f |port set|ting. */|
|00000c80| 0d 0d 0d 2f 2a 20 43 6c | 69 70 62 6f 61 72 64 20 |.../* Cl|ipboard |
|00000c90| 73 74 72 61 74 65 67 79 | 3a 0d 0d 20 20 20 54 68 |strategy|:.. Th|
|00000ca0| 69 73 20 70 72 6f 67 72 | 61 6d 20 64 6f 65 73 20 |is progr|am does |
|00000cb0| 6e 6f 74 20 6d 61 69 6e | 74 61 69 6e 20 61 20 70 |not main|tain a p|
|00000cc0| 72 69 76 61 74 65 20 73 | 63 72 61 70 2e 20 57 68 |rivate s|crap. Wh|
|00000cd0| 65 6e 65 76 65 72 20 61 | 20 63 75 74 2c 20 63 6f |enever a| cut, co|
|00000ce0| 70 79 2c 20 6f 72 20 70 | 61 73 74 65 0d 20 20 20 |py, or p|aste. |
|00000cf0| 6f 63 63 75 72 73 2c 20 | 77 65 20 69 6d 70 6f 72 |occurs, |we impor|
|00000d00| 74 2f 65 78 70 6f 72 74 | 20 66 72 6f 6d 20 74 68 |t/export| from th|
|00000d10| 65 20 70 75 62 6c 69 63 | 20 73 63 72 61 70 20 74 |e public| scrap t|
|00000d20| 6f 20 54 65 78 74 45 64 | 69 74 27 73 20 73 63 72 |o TextEd|it's scr|
|00000d30| 61 70 20 72 69 67 68 74 | 20 61 77 61 79 2c 0d 20 |ap right| away,. |
|00000d40| 20 20 75 73 69 6e 67 20 | 74 68 65 20 54 45 54 6f | using |the TETo|
|00000d50| 53 63 72 61 70 20 61 6e | 64 20 54 45 46 72 6f 6d |Scrap an|d TEFrom|
|00000d60| 53 63 72 61 70 20 72 6f | 75 74 69 6e 65 73 2e 20 |Scrap ro|utines. |
|00000d70| 49 66 20 77 65 20 64 69 | 64 20 75 73 65 20 61 20 |If we di|d use a |
|00000d80| 70 72 69 76 61 74 65 20 | 73 63 72 61 70 2c 0d 20 |private |scrap,. |
|00000d90| 20 20 74 68 65 20 69 6d | 70 6f 72 74 2f 65 78 70 | the im|port/exp|
|00000da0| 6f 72 74 20 77 6f 75 6c | 64 20 62 65 20 69 6e 20 |ort woul|d be in |
|00000db0| 74 68 65 20 61 63 74 69 | 76 61 74 65 2f 64 65 61 |the acti|vate/dea|
|00000dc0| 63 74 69 76 61 74 65 20 | 65 76 65 6e 74 20 61 6e |ctivate |event an|
|00000dd0| 64 20 73 75 73 70 65 6e | 64 2f 72 65 73 75 6d 65 |d suspen|d/resume|
|00000de0| 0d 20 20 20 65 76 65 6e | 74 20 72 6f 75 74 69 6e |. even|t routin|
|00000df0| 65 73 2e 20 2a 2f 0d 0d | 2f 2a 20 41 2f 55 58 20 |es. */..|/* A/UX |
|00000e00| 69 73 20 63 61 73 65 20 | 73 65 6e 73 69 74 69 76 |is case |sensitiv|
|00000e10| 65 2c 20 73 6f 20 75 73 | 65 20 63 6f 72 72 65 63 |e, so us|e correc|
|00000e20| 74 20 63 61 73 65 20 66 | 6f 72 20 69 6e 63 6c 75 |t case f|or inclu|
|00000e30| 64 65 20 66 69 6c 65 20 | 6e 61 6d 65 73 20 2a 2f |de file |names */|
|00000e40| 0d 23 69 6e 63 6c 75 64 | 65 20 3c 76 61 6c 75 65 |.#includ|e <value|
|00000e50| 73 2e 68 3e 0d 23 69 6e | 63 6c 75 64 65 20 3c 74 |s.h>.#in|clude <t|
|00000e60| 79 70 65 73 2e 68 3e 0d | 23 69 6e 63 6c 75 64 65 |ypes.h>.|#include|
|00000e70| 20 3c 71 75 69 63 6b 64 | 72 61 77 2e 68 3e 0d 23 | <quickd|raw.h>.#|
|00000e80| 69 6e 63 6c 75 64 65 20 | 3c 66 6f 6e 74 73 2e 68 |include |<fonts.h|
|00000e90| 3e 0d 23 69 6e 63 6c 75 | 64 65 20 3c 65 76 65 6e |>.#inclu|de <even|
|00000ea0| 74 73 2e 68 3e 0d 23 69 | 6e 63 6c 75 64 65 20 3c |ts.h>.#i|nclude <|
|00000eb0| 63 6f 6e 74 72 6f 6c 73 | 2e 68 3e 0d 23 69 6e 63 |controls|.h>.#inc|
|00000ec0| 6c 75 64 65 20 3c 77 69 | 6e 64 6f 77 73 2e 68 3e |lude <wi|ndows.h>|
|00000ed0| 0d 23 69 6e 63 6c 75 64 | 65 20 3c 6d 65 6e 75 73 |.#includ|e <menus|
|00000ee0| 2e 68 3e 0d 23 69 6e 63 | 6c 75 64 65 20 3c 74 65 |.h>.#inc|lude <te|
|00000ef0| 78 74 65 64 69 74 2e 68 | 3e 0d 23 69 6e 63 6c 75 |xtedit.h|>.#inclu|
|00000f00| 64 65 20 3c 64 69 61 6c | 6f 67 73 2e 68 3e 0d 23 |de <dial|ogs.h>.#|
|00000f10| 69 6e 63 6c 75 64 65 20 | 3c 64 65 73 6b 2e 68 3e |include |<desk.h>|
|00000f20| 0d 23 69 6e 63 6c 75 64 | 65 20 3c 73 63 72 61 70 |.#includ|e <scrap|
|00000f30| 2e 68 3e 0d 23 69 6e 63 | 6c 75 64 65 20 3c 74 6f |.h>.#inc|lude <to|
|00000f40| 6f 6c 75 74 69 6c 73 2e | 68 3e 0d 23 69 6e 63 6c |olutils.|h>.#incl|
|00000f50| 75 64 65 20 3c 6d 65 6d | 6f 72 79 2e 68 3e 0d 23 |ude <mem|ory.h>.#|
|00000f60| 69 6e 63 6c 75 64 65 20 | 3c 73 65 67 6c 6f 61 64 |include |<segload|
|00000f70| 2e 68 3e 0d 23 69 6e 63 | 6c 75 64 65 20 3c 66 69 |.h>.#inc|lude <fi|
|00000f80| 6c 65 73 2e 68 3e 0d 23 | 69 6e 63 6c 75 64 65 20 |les.h>.#|include |
|00000f90| 3c 6f 73 75 74 69 6c 73 | 2e 68 3e 0d 23 69 6e 63 |<osutils|.h>.#inc|
|00000fa0| 6c 75 64 65 20 3c 6f 73 | 65 76 65 6e 74 73 2e 68 |lude <os|events.h|
|00000fb0| 3e 0d 23 69 66 6e 64 65 | 66 20 41 55 58 0d 23 20 |>.#ifnde|f AUX.# |
|00000fc0| 20 69 6e 63 6c 75 64 65 | 20 3c 64 69 73 6b 69 6e | include| <diskin|
|00000fd0| 69 74 2e 68 3e 0d 23 65 | 6e 64 69 66 0d 23 69 6e |it.h>.#e|ndif.#in|
|00000fe0| 63 6c 75 64 65 20 3c 70 | 61 63 6b 61 67 65 73 2e |clude <p|ackages.|
|00000ff0| 68 3e 0d 23 69 6e 63 6c | 75 64 65 20 22 54 45 53 |h>.#incl|ude "TES|
|00001000| 61 6d 70 6c 65 2e 68 22 | 09 09 2f 2a 20 62 72 69 |ample.h"|../* bri|
|00001010| 6e 67 20 69 6e 20 61 6c | 6c 20 74 68 65 20 23 64 |ng in al|l the #d|
|00001020| 65 66 69 6e 65 73 20 66 | 6f 72 20 54 45 53 61 6d |efines f|or TESam|
|00001030| 70 6c 65 20 2a 2f 0d 23 | 69 6e 63 6c 75 64 65 20 |ple */.#|include |
|00001040| 3c 74 72 61 70 73 2e 68 | 3e 0d 0d 2f 2a 20 41 2f |<traps.h|>../* A/|
|00001050| 55 58 20 43 20 75 6e 64 | 65 72 73 74 61 6e 64 73 |UX C und|erstands|
|00001060| 20 6e 65 69 74 68 65 72 | 20 23 70 72 61 67 6d 61 | neither| #pragma|
|00001070| 2c 20 6e 6f 72 20 73 65 | 67 6d 65 6e 74 73 2c 20 |, nor se|gments, |
|00001080| 73 6f 20 64 65 66 69 6e | 65 20 70 72 61 67 6d 61 |so defin|e pragma|
|00001090| 20 74 6f 0d 20 2a 20 73 | 6f 6d 65 74 68 69 6e 67 | to. * s|omething|
|000010a0| 20 68 61 72 6d 6c 65 73 | 73 20 28 73 68 6f 75 6c | harmles|s (shoul|
|000010b0| 64 20 74 68 69 73 20 62 | 65 20 69 6e 20 54 45 53 |d this b|e in TES|
|000010c0| 61 6d 70 6c 65 2e 68 3f | 29 20 2a 2f 0d 23 69 66 |ample.h?|) */.#if|
|000010d0| 64 65 66 20 41 55 58 0d | 23 64 65 66 69 6e 65 20 |def AUX.|#define |
|000010e0| 70 72 61 67 6d 61 20 75 | 6e 64 65 66 0d 23 65 6e |pragma u|ndef.#en|
|000010f0| 64 69 66 0d 0d 0d 2f 2a | 20 41 20 44 6f 63 75 6d |dif.../*| A Docum|
|00001100| 65 6e 74 52 65 63 6f 72 | 64 20 63 6f 6e 74 61 69 |entRecor|d contai|
|00001110| 6e 73 20 74 68 65 20 57 | 69 6e 64 6f 77 52 65 63 |ns the W|indowRec|
|00001120| 6f 72 64 20 66 6f 72 20 | 6f 6e 65 20 6f 66 20 6f |ord for |one of o|
|00001130| 75 72 20 64 6f 63 75 6d | 65 6e 74 20 77 69 6e 64 |ur docum|ent wind|
|00001140| 6f 77 73 2c 0d 20 20 20 | 61 73 20 77 65 6c 6c 20 |ows,. |as well |
|00001150| 61 73 20 74 68 65 20 54 | 45 48 61 6e 64 6c 65 20 |as the T|EHandle |
|00001160| 66 6f 72 20 74 68 65 20 | 74 65 78 74 20 77 65 20 |for the |text we |
|00001170| 61 72 65 20 65 64 69 74 | 69 6e 67 2e 20 4f 74 68 |are edit|ing. Oth|
|00001180| 65 72 20 64 6f 63 75 6d | 65 6e 74 20 66 69 65 6c |er docum|ent fiel|
|00001190| 64 73 0d 20 20 20 63 61 | 6e 20 62 65 20 61 64 64 |ds. ca|n be add|
|000011a0| 65 64 20 74 6f 20 74 68 | 69 73 20 72 65 63 6f 72 |ed to th|is recor|
|000011b0| 64 20 61 73 20 6e 65 65 | 64 65 64 2e 20 46 6f 72 |d as nee|ded. For|
|000011c0| 20 61 20 73 69 6d 69 6c | 61 72 20 65 78 61 6d 70 | a simil|ar examp|
|000011d0| 6c 65 2c 20 73 65 65 20 | 68 6f 77 20 74 68 65 0d |le, see |how the.|
|000011e0| 20 20 20 57 69 6e 64 6f | 77 20 4d 61 6e 61 67 65 | Windo|w Manage|
|000011f0| 72 20 61 6e 64 20 44 69 | 61 6c 6f 67 20 4d 61 6e |r and Di|alog Man|
|00001200| 61 67 65 72 20 61 64 64 | 20 66 69 65 6c 64 73 20 |ager add| fields |
|00001210| 61 66 74 65 72 20 74 68 | 65 20 47 72 61 66 50 6f |after th|e GrafPo|
|00001220| 72 74 2e 20 2a 2f 0d 74 | 79 70 65 64 65 66 20 73 |rt. */.t|ypedef s|
|00001230| 74 72 75 63 74 20 7b 0d | 09 57 69 6e 64 6f 77 52 |truct {.|.WindowR|
|00001240| 65 63 6f 72 64 09 64 6f | 63 57 69 6e 64 6f 77 3b |ecord.do|cWindow;|
|00001250| 0d 09 54 45 48 61 6e 64 | 6c 65 09 09 64 6f 63 54 |..TEHand|le..docT|
|00001260| 45 3b 0d 09 43 6f 6e 74 | 72 6f 6c 48 61 6e 64 6c |E;..Cont|rolHandl|
|00001270| 65 09 64 6f 63 56 53 63 | 72 6f 6c 6c 3b 0d 09 43 |e.docVSc|roll;..C|
|00001280| 6f 6e 74 72 6f 6c 48 61 | 6e 64 6c 65 09 64 6f 63 |ontrolHa|ndle.doc|
|00001290| 48 53 63 72 6f 6c 6c 3b | 0d 09 50 72 6f 63 50 74 |HScroll;|..ProcPt|
|000012a0| 72 09 09 09 64 6f 63 43 | 6c 69 6b 3b 0d 7d 20 44 |r...docC|lik;.} D|
|000012b0| 6f 63 75 6d 65 6e 74 52 | 65 63 6f 72 64 2c 20 2a |ocumentR|ecord, *|
|000012c0| 44 6f 63 75 6d 65 6e 74 | 50 65 65 6b 3b 0d 0d 0d |Document|Peek;...|
|000012d0| 0d 2f 2a 20 54 68 65 20 | 22 67 22 20 70 72 65 66 |./* The |"g" pref|
|000012e0| 69 78 20 69 73 20 75 73 | 65 64 20 74 6f 20 65 6d |ix is us|ed to em|
|000012f0| 70 68 61 73 69 7a 65 20 | 74 68 61 74 20 61 20 76 |phasize |that a v|
|00001300| 61 72 69 61 62 6c 65 20 | 69 73 20 67 6c 6f 62 61 |ariable |is globa|
|00001310| 6c 2e 20 2a 2f 0d 0d 2f | 2a 20 47 4d 61 63 20 69 |l. */../|* GMac i|
|00001320| 73 20 75 73 65 64 20 74 | 6f 20 68 6f 6c 64 20 74 |s used t|o hold t|
|00001330| 68 65 20 72 65 73 75 6c | 74 20 6f 66 20 61 20 53 |he resul|t of a S|
|00001340| 79 73 45 6e 76 69 72 6f | 6e 73 20 63 61 6c 6c 2e |ysEnviro|ns call.|
|00001350| 20 54 68 69 73 20 6d 61 | 6b 65 73 0d 20 20 20 69 | This ma|kes. i|
|00001360| 74 20 63 6f 6e 76 65 6e | 69 65 6e 74 20 66 6f 72 |t conven|ient for|
|00001370| 20 61 6e 79 20 72 6f 75 | 74 69 6e 65 20 74 6f 20 | any rou|tine to |
|00001380| 63 68 65 63 6b 20 74 68 | 65 20 65 6e 76 69 72 6f |check th|e enviro|
|00001390| 6e 6d 65 6e 74 2e 20 49 | 74 20 69 73 0d 20 20 20 |nment. I|t is. |
|000013a0| 67 6c 6f 62 61 6c 20 69 | 6e 66 6f 72 6d 61 74 69 |global i|nformati|
|000013b0| 6f 6e 2c 20 61 6e 79 77 | 61 79 2e 20 2a 2f 0d 53 |on, anyw|ay. */.S|
|000013c0| 79 73 45 6e 76 52 65 63 | 09 67 4d 61 63 3b 09 09 |ysEnvRec|.gMac;..|
|000013d0| 09 09 2f 2a 20 73 65 74 | 20 75 70 20 62 79 20 49 |../* set| up by I|
|000013e0| 6e 69 74 69 61 6c 69 7a | 65 20 2a 2f 0d 0d 2f 2a |nitializ|e */../*|
|000013f0| 20 47 48 61 73 57 61 69 | 74 4e 65 78 74 45 76 65 | GHasWai|tNextEve|
|00001400| 6e 74 20 69 73 20 73 65 | 74 20 61 74 20 73 74 61 |nt is se|t at sta|
|00001410| 72 74 75 70 2c 20 61 6e | 64 20 74 65 6c 6c 73 20 |rtup, an|d tells |
|00001420| 77 68 65 74 68 65 72 20 | 74 68 65 20 57 61 69 74 |whether |the Wait|
|00001430| 4e 65 78 74 45 76 65 6e | 74 0d 20 20 20 74 72 61 |NextEven|t. tra|
|00001440| 70 20 69 73 20 61 76 61 | 69 6c 61 62 6c 65 2e 20 |p is ava|ilable. |
|00001450| 49 66 20 69 74 20 69 73 | 20 66 61 6c 73 65 2c 20 |If it is| false, |
|00001460| 77 65 20 6b 6e 6f 77 20 | 74 68 61 74 20 77 65 20 |we know |that we |
|00001470| 6d 75 73 74 20 63 61 6c | 6c 20 47 65 74 4e 65 78 |must cal|l GetNex|
|00001480| 74 45 76 65 6e 74 2e 20 | 2a 2f 0d 42 6f 6f 6c 65 |tEvent. |*/.Boole|
|00001490| 61 6e 09 09 67 48 61 73 | 57 61 69 74 4e 65 78 74 |an..gHas|WaitNext|
|000014a0| 45 76 65 6e 74 3b 09 2f | 2a 20 73 65 74 20 75 70 |Event;./|* set up|
|000014b0| 20 62 79 20 49 6e 69 74 | 69 61 6c 69 7a 65 20 2a | by Init|ialize *|
|000014c0| 2f 0d 0d 2f 2a 20 47 49 | 6e 42 61 63 6b 67 72 6f |/../* GI|nBackgro|
|000014d0| 75 6e 64 20 69 73 20 6d | 61 69 6e 74 61 69 6e 65 |und is m|aintaine|
|000014e0| 64 20 62 79 20 6f 75 72 | 20 4f 53 45 76 65 6e 74 |d by our| OSEvent|
|000014f0| 20 68 61 6e 64 6c 69 6e | 67 20 72 6f 75 74 69 6e | handlin|g routin|
|00001500| 65 73 2e 20 41 6e 79 20 | 70 61 72 74 20 6f 66 0d |es. Any |part of.|
|00001510| 20 20 20 74 68 65 20 70 | 72 6f 67 72 61 6d 20 63 | the p|rogram c|
|00001520| 61 6e 20 63 68 65 63 6b | 20 69 74 20 74 6f 20 66 |an check| it to f|
|00001530| 69 6e 64 20 6f 75 74 20 | 69 66 20 69 74 20 69 73 |ind out |if it is|
|00001540| 20 63 75 72 72 65 6e 74 | 6c 79 20 69 6e 20 74 68 | current|ly in th|
|00001550| 65 20 62 61 63 6b 67 72 | 6f 75 6e 64 2e 20 2a 2f |e backgr|ound. */|
|00001560| 0d 42 6f 6f 6c 65 61 6e | 09 09 67 49 6e 42 61 63 |.Boolean|..gInBac|
|00001570| 6b 67 72 6f 75 6e 64 3b | 09 09 2f 2a 20 6d 61 69 |kground;|../* mai|
|00001580| 6e 74 61 69 6e 65 64 20 | 62 79 20 49 6e 69 74 69 |ntained |by Initi|
|00001590| 61 6c 69 7a 65 20 61 6e | 64 20 44 6f 45 76 65 6e |alize an|d DoEven|
|000015a0| 74 20 2a 2f 0d 0d 2f 2a | 20 47 4e 75 6d 44 6f 63 |t */../*| GNumDoc|
|000015b0| 75 6d 65 6e 74 73 20 69 | 73 20 75 73 65 64 20 74 |uments i|s used t|
|000015c0| 6f 20 6b 65 65 70 20 74 | 72 61 63 6b 20 6f 66 20 |o keep t|rack of |
|000015d0| 68 6f 77 20 6d 61 6e 79 | 20 6f 70 65 6e 20 64 6f |how many| open do|
|000015e0| 63 75 6d 65 6e 74 73 20 | 74 68 65 72 65 20 61 72 |cuments |there ar|
|000015f0| 65 0d 20 20 20 61 74 20 | 61 6e 79 20 74 69 6d 65 |e. at |any time|
|00001600| 2e 20 49 74 20 69 73 20 | 6d 61 69 6e 74 61 69 6e |. It is |maintain|
|00001610| 65 64 20 62 79 20 74 68 | 65 20 72 6f 75 74 69 6e |ed by th|e routin|
|00001620| 65 73 20 74 68 61 74 20 | 6f 70 65 6e 20 61 6e 64 |es that |open and|
|00001630| 20 63 6c 6f 73 65 20 64 | 6f 63 75 6d 65 6e 74 73 | close d|ocuments|
|00001640| 2e 20 2a 2f 0d 73 68 6f | 72 74 09 09 67 4e 75 6d |. */.sho|rt..gNum|
|00001650| 44 6f 63 75 6d 65 6e 74 | 73 3b 09 09 2f 2a 20 6d |Document|s;../* m|
|00001660| 61 69 6e 74 61 69 6e 65 | 64 20 62 79 20 49 6e 69 |aintaine|d by Ini|
|00001670| 74 69 61 6c 69 7a 65 2c | 20 44 6f 4e 65 77 2c 20 |tialize,| DoNew, |
|00001680| 61 6e 64 20 44 6f 43 6c | 6f 73 65 57 69 6e 64 6f |and DoCl|oseWindo|
|00001690| 77 20 2a 2f 0d 0d 0d 2f | 2a 20 48 65 72 65 20 61 |w */.../|* Here a|
|000016a0| 72 65 20 64 65 63 6c 61 | 72 61 74 69 6f 6e 73 20 |re decla|rations |
|000016b0| 66 6f 72 20 61 6c 6c 20 | 6f 66 20 74 68 65 20 43 |for all |of the C|
|000016c0| 20 72 6f 75 74 69 6e 65 | 73 2e 20 49 6e 20 4d 50 | routine|s. In MP|
|000016d0| 57 20 33 2e 30 20 77 65 | 20 63 61 6e 20 75 73 65 |W 3.0 we| can use|
|000016e0| 0d 20 20 20 61 63 74 75 | 61 6c 20 70 72 6f 74 6f |. actu|al proto|
|000016f0| 74 79 70 65 73 20 66 6f | 72 20 70 61 72 61 6d 65 |types fo|r parame|
|00001700| 74 65 72 20 74 79 70 65 | 20 63 68 65 63 6b 69 6e |ter type| checkin|
|00001710| 67 2e 20 41 2f 55 58 20 | 43 20 64 6f 65 73 20 6e |g. A/UX |C does n|
|00001720| 6f 74 20 67 72 6f 6b 0d | 20 20 20 70 72 6f 74 6f |ot grok.| proto|
|00001730| 74 79 70 65 73 2c 20 73 | 6f 20 65 6c 69 6d 69 6e |types, s|o elimin|
|00001740| 61 74 65 20 74 68 65 6d | 20 75 6e 64 65 72 20 41 |ate them| under A|
|00001750| 2f 55 58 20 2a 2f 0d 23 | 69 66 6e 64 65 66 20 41 |/UX */.#|ifndef A|
|00001760| 55 58 0d 09 76 6f 69 64 | 20 41 6c 65 72 74 55 73 |UX..void| AlertUs|
|00001770| 65 72 28 20 73 68 6f 72 | 74 20 65 72 72 6f 72 20 |er( shor|t error |
|00001780| 29 3b 0d 09 76 6f 69 64 | 20 45 76 65 6e 74 4c 6f |);..void| EventLo|
|00001790| 6f 70 28 20 76 6f 69 64 | 20 29 3b 0d 09 76 6f 69 |op( void| );..voi|
|000017a0| 64 20 44 6f 45 76 65 6e | 74 28 20 45 76 65 6e 74 |d DoEven|t( Event|
|000017b0| 52 65 63 6f 72 64 20 2a | 65 76 65 6e 74 20 29 3b |Record *|event );|
|000017c0| 0d 09 76 6f 69 64 20 41 | 64 6a 75 73 74 43 75 72 |..void A|djustCur|
|000017d0| 73 6f 72 28 20 50 6f 69 | 6e 74 20 6d 6f 75 73 65 |sor( Poi|nt mouse|
|000017e0| 2c 20 52 67 6e 48 61 6e | 64 6c 65 20 72 65 67 69 |, RgnHan|dle regi|
|000017f0| 6f 6e 20 29 3b 0d 09 76 | 6f 69 64 20 47 65 74 47 |on );..v|oid GetG|
|00001800| 6c 6f 62 61 6c 4d 6f 75 | 73 65 28 20 50 6f 69 6e |lobalMou|se( Poin|
|00001810| 74 20 2a 6d 6f 75 73 65 | 20 29 3b 0d 09 76 6f 69 |t *mouse| );..voi|
|00001820| 64 20 44 6f 47 72 6f 77 | 57 69 6e 64 6f 77 28 20 |d DoGrow|Window( |
|00001830| 57 69 6e 64 6f 77 50 74 | 72 20 77 69 6e 64 6f 77 |WindowPt|r window|
|00001840| 2c 20 45 76 65 6e 74 52 | 65 63 6f 72 64 20 2a 65 |, EventR|ecord *e|
|00001850| 76 65 6e 74 20 29 3b 0d | 09 76 6f 69 64 20 44 6f |vent );.|.void Do|
|00001860| 5a 6f 6f 6d 57 69 6e 64 | 6f 77 28 20 57 69 6e 64 |ZoomWind|ow( Wind|
|00001870| 6f 77 50 74 72 20 77 69 | 6e 64 6f 77 2c 20 73 68 |owPtr wi|ndow, sh|
|00001880| 6f 72 74 20 70 61 72 74 | 20 29 3b 0d 09 76 6f 69 |ort part| );..voi|
|00001890| 64 20 52 65 73 69 7a 65 | 57 69 6e 64 6f 77 28 20 |d Resize|Window( |
|000018a0| 57 69 6e 64 6f 77 50 74 | 72 20 77 69 6e 64 6f 77 |WindowPt|r window|
|000018b0| 20 29 3b 0d 09 76 6f 69 | 64 20 47 65 74 4c 6f 63 | );..voi|d GetLoc|
|000018c0| 61 6c 55 70 64 61 74 65 | 52 67 6e 28 20 57 69 6e |alUpdate|Rgn( Win|
|000018d0| 64 6f 77 50 74 72 20 77 | 69 6e 64 6f 77 2c 20 52 |dowPtr w|indow, R|
|000018e0| 67 6e 48 61 6e 64 6c 65 | 20 6c 6f 63 61 6c 52 67 |gnHandle| localRg|
|000018f0| 6e 20 29 3b 0d 09 76 6f | 69 64 20 44 6f 55 70 64 |n );..vo|id DoUpd|
|00001900| 61 74 65 28 20 57 69 6e | 64 6f 77 50 74 72 20 77 |ate( Win|dowPtr w|
|00001910| 69 6e 64 6f 77 20 29 3b | 0d 09 76 6f 69 64 20 44 |indow );|..void D|
|00001920| 6f 44 65 61 63 74 69 76 | 61 74 65 28 20 57 69 6e |oDeactiv|ate( Win|
|00001930| 64 6f 77 50 74 72 20 77 | 69 6e 64 6f 77 20 29 3b |dowPtr w|indow );|
|00001940| 0d 09 76 6f 69 64 20 44 | 6f 41 63 74 69 76 61 74 |..void D|oActivat|
|00001950| 65 28 20 57 69 6e 64 6f | 77 50 74 72 20 77 69 6e |e( Windo|wPtr win|
|00001960| 64 6f 77 2c 20 42 6f 6f | 6c 65 61 6e 20 62 65 63 |dow, Boo|lean bec|
|00001970| 6f 6d 69 6e 67 41 63 74 | 69 76 65 20 29 3b 0d 09 |omingAct|ive );..|
|00001980| 76 6f 69 64 20 44 6f 43 | 6f 6e 74 65 6e 74 43 6c |void DoC|ontentCl|
|00001990| 69 63 6b 28 20 57 69 6e | 64 6f 77 50 74 72 20 77 |ick( Win|dowPtr w|
|000019a0| 69 6e 64 6f 77 2c 20 45 | 76 65 6e 74 52 65 63 6f |indow, E|ventReco|
|000019b0| 72 64 20 2a 65 76 65 6e | 74 20 29 3b 0d 09 76 6f |rd *even|t );..vo|
|000019c0| 69 64 20 44 6f 4b 65 79 | 44 6f 77 6e 28 20 45 76 |id DoKey|Down( Ev|
|000019d0| 65 6e 74 52 65 63 6f 72 | 64 20 2a 65 76 65 6e 74 |entRecor|d *event|
|000019e0| 20 29 3b 0d 09 75 6e 73 | 69 67 6e 65 64 20 6c 6f | );..uns|igned lo|
|000019f0| 6e 67 20 47 65 74 53 6c | 65 65 70 28 20 76 6f 69 |ng GetSl|eep( voi|
|00001a00| 64 20 29 3b 0d 09 76 6f | 69 64 20 43 6f 6d 6d 6f |d );..vo|id Commo|
|00001a10| 6e 41 63 74 69 6f 6e 28 | 20 43 6f 6e 74 72 6f 6c |nAction(| Control|
|00001a20| 48 61 6e 64 6c 65 20 63 | 6f 6e 74 72 6f 6c 2c 20 |Handle c|ontrol, |
|00001a30| 73 68 6f 72 74 20 2a 61 | 6d 6f 75 6e 74 20 29 3b |short *a|mount );|
|00001a40| 0d 09 70 61 73 63 61 6c | 20 76 6f 69 64 20 56 41 |..pascal| void VA|
|00001a50| 63 74 69 6f 6e 50 72 6f | 63 28 20 43 6f 6e 74 72 |ctionPro|c( Contr|
|00001a60| 6f 6c 48 61 6e 64 6c 65 | 20 63 6f 6e 74 72 6f 6c |olHandle| control|
|00001a70| 2c 20 73 68 6f 72 74 20 | 70 61 72 74 20 29 3b 0d |, short |part );.|
|00001a80| 09 70 61 73 63 61 6c 20 | 76 6f 69 64 20 48 41 63 |.pascal |void HAc|
|00001a90| 74 69 6f 6e 50 72 6f 63 | 28 20 43 6f 6e 74 72 6f |tionProc|( Contro|
|00001aa0| 6c 48 61 6e 64 6c 65 20 | 63 6f 6e 74 72 6f 6c 2c |lHandle |control,|
|00001ab0| 20 73 68 6f 72 74 20 70 | 61 72 74 20 29 3b 0d 09 | short p|art );..|
|00001ac0| 76 6f 69 64 20 44 6f 49 | 64 6c 65 28 20 76 6f 69 |void DoI|dle( voi|
|00001ad0| 64 20 29 3b 0d 09 76 6f | 69 64 20 44 72 61 77 57 |d );..vo|id DrawW|
|00001ae0| 69 6e 64 6f 77 28 20 57 | 69 6e 64 6f 77 50 74 72 |indow( W|indowPtr|
|00001af0| 20 77 69 6e 64 6f 77 20 | 29 3b 0d 09 76 6f 69 64 | window |);..void|
|00001b00| 20 41 64 6a 75 73 74 4d | 65 6e 75 73 28 20 76 6f | AdjustM|enus( vo|
|00001b10| 69 64 20 29 3b 0d 09 76 | 6f 69 64 20 44 6f 4d 65 |id );..v|oid DoMe|
|00001b20| 6e 75 43 6f 6d 6d 61 6e | 64 28 20 6c 6f 6e 67 20 |nuComman|d( long |
|00001b30| 6d 65 6e 75 52 65 73 75 | 6c 74 20 29 3b 0d 09 76 |menuResu|lt );..v|
|00001b40| 6f 69 64 20 44 6f 4e 65 | 77 28 20 76 6f 69 64 20 |oid DoNe|w( void |
|00001b50| 29 3b 0d 09 42 6f 6f 6c | 65 61 6e 20 44 6f 43 6c |);..Bool|ean DoCl|
|00001b60| 6f 73 65 57 69 6e 64 6f | 77 28 20 57 69 6e 64 6f |oseWindo|w( Windo|
|00001b70| 77 50 74 72 20 77 69 6e | 64 6f 77 20 29 3b 0d 09 |wPtr win|dow );..|
|00001b80| 76 6f 69 64 20 54 65 72 | 6d 69 6e 61 74 65 28 20 |void Ter|minate( |
|00001b90| 76 6f 69 64 20 29 3b 0d | 09 76 6f 69 64 20 49 6e |void );.|.void In|
|00001ba0| 69 74 69 61 6c 69 7a 65 | 28 20 76 6f 69 64 20 29 |itialize|( void )|
|00001bb0| 3b 0d 09 76 6f 69 64 20 | 42 69 67 42 61 64 45 72 |;..void |BigBadEr|
|00001bc0| 72 6f 72 28 20 73 68 6f | 72 74 20 65 72 72 6f 72 |ror( sho|rt error|
|00001bd0| 20 29 3b 0d 09 76 6f 69 | 64 20 47 65 74 54 45 52 | );..voi|d GetTER|
|00001be0| 65 63 74 28 20 57 69 6e | 64 6f 77 50 74 72 20 77 |ect( Win|dowPtr w|
|00001bf0| 69 6e 64 6f 77 2c 20 52 | 65 63 74 20 2a 74 65 52 |indow, R|ect *teR|
|00001c00| 65 63 74 20 29 3b 0d 09 | 76 6f 69 64 20 41 64 6a |ect );..|void Adj|
|00001c10| 75 73 74 56 69 65 77 52 | 65 63 74 28 20 54 45 48 |ustViewR|ect( TEH|
|00001c20| 61 6e 64 6c 65 20 64 6f | 63 54 45 20 29 3b 0d 09 |andle do|cTE );..|
|00001c30| 76 6f 69 64 20 41 64 6a | 75 73 74 54 45 28 20 57 |void Adj|ustTE( W|
|00001c40| 69 6e 64 6f 77 50 74 72 | 20 77 69 6e 64 6f 77 20 |indowPtr| window |
|00001c50| 29 3b 0d 09 76 6f 69 64 | 20 41 64 6a 75 73 74 48 |);..void| AdjustH|
|00001c60| 56 28 20 42 6f 6f 6c 65 | 61 6e 20 69 73 56 65 72 |V( Boole|an isVer|
|00001c70| 74 2c 20 43 6f 6e 74 72 | 6f 6c 48 61 6e 64 6c 65 |t, Contr|olHandle|
|00001c80| 20 63 6f 6e 74 72 6f 6c | 2c 20 54 45 48 61 6e 64 | control|, TEHand|
|00001c90| 6c 65 20 64 6f 63 54 45 | 2c 0d 09 09 09 09 09 42 |le docTE|,......B|
|00001ca0| 6f 6f 6c 65 61 6e 20 63 | 61 6e 52 65 64 72 61 77 |oolean c|anRedraw|
|00001cb0| 20 29 3b 0d 09 76 6f 69 | 64 20 41 64 6a 75 73 74 | );..voi|d Adjust|
|00001cc0| 53 63 72 6f 6c 6c 56 61 | 6c 75 65 73 28 20 57 69 |ScrollVa|lues( Wi|
|00001cd0| 6e 64 6f 77 50 74 72 20 | 77 69 6e 64 6f 77 2c 20 |ndowPtr |window, |
|00001ce0| 42 6f 6f 6c 65 61 6e 20 | 63 61 6e 52 65 64 72 61 |Boolean |canRedra|
|00001cf0| 77 20 29 3b 0d 09 76 6f | 69 64 20 41 64 6a 75 73 |w );..vo|id Adjus|
|00001d00| 74 53 63 72 6f 6c 6c 53 | 69 7a 65 73 28 20 57 69 |tScrollS|izes( Wi|
|00001d10| 6e 64 6f 77 50 74 72 20 | 77 69 6e 64 6f 77 20 29 |ndowPtr |window )|
|00001d20| 3b 0d 09 76 6f 69 64 20 | 41 64 6a 75 73 74 53 63 |;..void |AdjustSc|
|00001d30| 72 6f 6c 6c 62 61 72 73 | 28 20 57 69 6e 64 6f 77 |rollbars|( Window|
|00001d40| 50 74 72 20 77 69 6e 64 | 6f 77 2c 20 42 6f 6f 6c |Ptr wind|ow, Bool|
|00001d50| 65 61 6e 20 6e 65 65 64 | 73 52 65 73 69 7a 65 20 |ean need|sResize |
|00001d60| 29 3b 0d 09 70 61 73 63 | 61 6c 20 76 6f 69 64 20 |);..pasc|al void |
|00001d70| 50 61 73 63 61 6c 43 6c | 69 6b 4c 6f 6f 70 28 29 |PascalCl|ikLoop()|
|00001d80| 3b 0d 09 70 61 73 63 61 | 6c 20 50 72 6f 63 50 74 |;..pasca|l ProcPt|
|00001d90| 72 20 47 65 74 4f 6c 64 | 43 6c 69 6b 4c 6f 6f 70 |r GetOld|ClikLoop|
|00001da0| 28 29 3b 0d 09 42 6f 6f | 6c 65 61 6e 20 49 73 41 |();..Boo|lean IsA|
|00001db0| 70 70 57 69 6e 64 6f 77 | 28 20 57 69 6e 64 6f 77 |ppWindow|( Window|
|00001dc0| 50 74 72 20 77 69 6e 64 | 6f 77 20 29 3b 0d 09 42 |Ptr wind|ow );..B|
|00001dd0| 6f 6f 6c 65 61 6e 20 49 | 73 44 41 57 69 6e 64 6f |oolean I|sDAWindo|
|00001de0| 77 28 20 57 69 6e 64 6f | 77 50 74 72 20 77 69 6e |w( Windo|wPtr win|
|00001df0| 64 6f 77 20 29 3b 0d 09 | 42 6f 6f 6c 65 61 6e 20 |dow );..|Boolean |
|00001e00| 54 72 61 70 41 76 61 69 | 6c 61 62 6c 65 28 20 73 |TrapAvai|lable( s|
|00001e10| 68 6f 72 74 20 74 4e 75 | 6d 62 65 72 2c 20 54 72 |hort tNu|mber, Tr|
|00001e20| 61 70 54 79 70 65 20 74 | 54 79 70 65 20 29 3b 0d |apType t|Type );.|
|00001e30| 23 65 6c 73 65 0d 09 76 | 6f 69 64 20 41 6c 65 72 |#else..v|oid Aler|
|00001e40| 74 55 73 65 72 28 20 29 | 3b 0d 09 76 6f 69 64 20 |tUser( )|;..void |
|00001e50| 45 76 65 6e 74 4c 6f 6f | 70 28 20 29 3b 0d 09 76 |EventLoo|p( );..v|
|00001e60| 6f 69 64 20 44 6f 45 76 | 65 6e 74 28 20 29 3b 0d |oid DoEv|ent( );.|
|00001e70| 09 76 6f 69 64 20 41 64 | 6a 75 73 74 43 75 72 73 |.void Ad|justCurs|
|00001e80| 6f 72 28 20 29 3b 0d 09 | 76 6f 69 64 20 47 65 74 |or( );..|void Get|
|00001e90| 47 6c 6f 62 61 6c 4d 6f | 75 73 65 28 20 29 3b 0d |GlobalMo|use( );.|
|00001ea0| 09 76 6f 69 64 20 44 6f | 47 72 6f 77 57 69 6e 64 |.void Do|GrowWind|
|00001eb0| 6f 77 28 20 29 3b 0d 09 | 76 6f 69 64 20 44 6f 5a |ow( );..|void DoZ|
|00001ec0| 6f 6f 6d 57 69 6e 64 6f | 77 28 20 29 3b 0d 09 76 |oomWindo|w( );..v|
|00001ed0| 6f 69 64 20 52 65 73 69 | 7a 65 57 69 6e 64 6f 77 |oid Resi|zeWindow|
|00001ee0| 28 20 29 3b 0d 09 76 6f | 69 64 20 47 65 74 4c 6f |( );..vo|id GetLo|
|00001ef0| 63 61 6c 55 70 64 61 74 | 65 52 67 6e 28 20 29 3b |calUpdat|eRgn( );|
|00001f00| 0d 09 76 6f 69 64 20 44 | 6f 55 70 64 61 74 65 28 |..void D|oUpdate(|
|00001f10| 20 29 3b 0d 09 76 6f 69 | 64 20 44 6f 44 65 61 63 | );..voi|d DoDeac|
|00001f20| 74 69 76 61 74 65 28 20 | 29 3b 0d 09 76 6f 69 64 |tivate( |);..void|
|00001f30| 20 44 6f 41 63 74 69 76 | 61 74 65 28 20 29 3b 0d | DoActiv|ate( );.|
|00001f40| 09 76 6f 69 64 20 44 6f | 43 6f 6e 74 65 6e 74 43 |.void Do|ContentC|
|00001f50| 6c 69 63 6b 28 20 29 3b | 0d 09 76 6f 69 64 20 44 |lick( );|..void D|
|00001f60| 6f 4b 65 79 44 6f 77 6e | 28 20 29 3b 0d 09 75 6e |oKeyDown|( );..un|
|00001f70| 73 69 67 6e 65 64 20 6c | 6f 6e 67 20 47 65 74 53 |signed l|ong GetS|
|00001f80| 6c 65 65 70 28 20 29 3b | 0d 09 76 6f 69 64 20 43 |leep( );|..void C|
|00001f90| 6f 6d 6d 6f 6e 41 63 74 | 69 6f 6e 28 20 29 3b 0d |ommonAct|ion( );.|
|00001fa0| 09 76 6f 69 64 20 56 41 | 63 74 69 6f 6e 50 72 6f |.void VA|ctionPro|
|00001fb0| 63 28 20 29 3b 0d 09 76 | 6f 69 64 20 48 41 63 74 |c( );..v|oid HAct|
|00001fc0| 69 6f 6e 50 72 6f 63 28 | 20 29 3b 0d 09 76 6f 69 |ionProc(| );..voi|
|00001fd0| 64 20 44 6f 49 64 6c 65 | 28 20 29 3b 0d 09 76 6f |d DoIdle|( );..vo|
|00001fe0| 69 64 20 44 72 61 77 57 | 69 6e 64 6f 77 28 20 29 |id DrawW|indow( )|
|00001ff0| 3b 0d 09 76 6f 69 64 20 | 41 64 6a 75 73 74 4d 65 |;..void |AdjustMe|
|00002000| 6e 75 73 28 20 29 3b 0d | 09 76 6f 69 64 20 44 6f |nus( );.|.void Do|
|00002010| 4d 65 6e 75 43 6f 6d 6d | 61 6e 64 28 20 29 3b 0d |MenuComm|and( );.|
|00002020| 09 76 6f 69 64 20 44 6f | 4e 65 77 28 20 29 3b 0d |.void Do|New( );.|
|00002030| 09 42 6f 6f 6c 65 61 6e | 20 44 6f 43 6c 6f 73 65 |.Boolean| DoClose|
|00002040| 57 69 6e 64 6f 77 28 20 | 29 3b 0d 09 76 6f 69 64 |Window( |);..void|
|00002050| 20 54 65 72 6d 69 6e 61 | 74 65 28 20 29 3b 0d 09 | Termina|te( );..|
|00002060| 76 6f 69 64 20 49 6e 69 | 74 69 61 6c 69 7a 65 28 |void Ini|tialize(|
|00002070| 20 29 3b 0d 09 76 6f 69 | 64 20 42 69 67 42 61 64 | );..voi|d BigBad|
|00002080| 45 72 72 6f 72 28 20 29 | 3b 20 0d 09 76 6f 69 64 |Error( )|; ..void|
|00002090| 20 47 65 74 54 45 52 65 | 63 74 28 20 29 3b 0d 09 | GetTERe|ct( );..|
|000020a0| 76 6f 69 64 20 41 64 6a | 75 73 74 56 69 65 77 52 |void Adj|ustViewR|
|000020b0| 65 63 74 28 20 29 3b 0d | 09 76 6f 69 64 20 41 64 |ect( );.|.void Ad|
|000020c0| 6a 75 73 74 54 45 28 20 | 29 3b 0d 09 76 6f 69 64 |justTE( |);..void|
|000020d0| 20 41 64 6a 75 73 74 48 | 56 28 20 29 3b 0d 09 76 | AdjustH|V( );..v|
|000020e0| 6f 69 64 20 41 64 6a 75 | 73 74 53 63 72 6f 6c 6c |oid Adju|stScroll|
|000020f0| 56 61 6c 75 65 73 28 20 | 29 3b 0d 09 76 6f 69 64 |Values( |);..void|
|00002100| 20 41 64 6a 75 73 74 53 | 63 72 6f 6c 6c 53 69 7a | AdjustS|crollSiz|
|00002110| 65 73 28 20 29 3b 0d 09 | 76 6f 69 64 20 41 64 6a |es( );..|void Adj|
|00002120| 75 73 74 53 63 72 6f 6c | 6c 62 61 72 73 28 20 29 |ustScrol|lbars( )|
|00002130| 3b 0d 09 76 6f 69 64 20 | 50 61 73 63 61 6c 43 6c |;..void |PascalCl|
|00002140| 69 6b 4c 6f 6f 70 28 29 | 3b 0d 09 50 72 6f 63 50 |ikLoop()|;..ProcP|
|00002150| 74 72 20 47 65 74 4f 6c | 64 43 6c 69 6b 4c 6f 6f |tr GetOl|dClikLoo|
|00002160| 70 28 29 3b 0d 09 42 6f | 6f 6c 65 61 6e 20 49 73 |p();..Bo|olean Is|
|00002170| 41 70 70 57 69 6e 64 6f | 77 28 20 29 3b 0d 09 42 |AppWindo|w( );..B|
|00002180| 6f 6f 6c 65 61 6e 20 49 | 73 44 41 57 69 6e 64 6f |oolean I|sDAWindo|
|00002190| 77 28 20 29 3b 0d 09 42 | 6f 6f 6c 65 61 6e 20 54 |w( );..B|oolean T|
|000021a0| 72 61 70 41 76 61 69 6c | 61 62 6c 65 28 20 29 3b |rapAvail|able( );|
|000021b0| 0d 23 65 6e 64 69 66 0d | 0d 0d 2f 2a 20 44 65 66 |.#endif.|../* Def|
|000021c0| 69 6e 65 20 48 69 57 72 | 64 20 61 6e 64 20 4c 6f |ine HiWr|d and Lo|
|000021d0| 57 72 64 20 6d 61 63 72 | 6f 73 20 66 6f 72 20 65 |Wrd macr|os for e|
|000021e0| 66 66 69 63 69 65 6e 63 | 79 2e 20 2a 2f 0d 23 64 |fficienc|y. */.#d|
|000021f0| 65 66 69 6e 65 20 48 69 | 57 72 64 28 61 4c 6f 6e |efine Hi|Wrd(aLon|
|00002200| 67 29 09 28 28 28 61 4c | 6f 6e 67 29 20 3e 3e 20 |g).(((aL|ong) >> |
|00002210| 31 36 29 20 26 20 30 78 | 46 46 46 46 29 0d 23 64 |16) & 0x|FFFF).#d|
|00002220| 65 66 69 6e 65 20 4c 6f | 57 72 64 28 61 4c 6f 6e |efine Lo|Wrd(aLon|
|00002230| 67 29 09 28 28 61 4c 6f | 6e 67 29 20 26 20 30 78 |g).((aLo|ng) & 0x|
|00002240| 46 46 46 46 29 0d 0d 2f | 2a 20 44 65 66 69 6e 65 |FFFF)../|* Define|
|00002250| 20 54 6f 70 4c 65 66 74 | 20 61 6e 64 20 42 6f 74 | TopLeft| and Bot|
|00002260| 52 69 67 68 74 20 6d 61 | 63 72 6f 73 20 66 6f 72 |Right ma|cros for|
|00002270| 20 63 6f 6e 76 65 6e 69 | 65 6e 63 65 2e 20 4e 6f | conveni|ence. No|
|00002280| 74 69 63 65 20 74 68 65 | 20 69 6d 70 6c 69 63 69 |tice the| implici|
|00002290| 74 0d 20 20 20 64 65 70 | 65 6e 64 65 6e 63 79 20 |t. dep|endency |
|000022a0| 6f 6e 20 74 68 65 20 6f | 72 64 65 72 69 6e 67 20 |on the o|rdering |
|000022b0| 6f 66 20 66 69 65 6c 64 | 73 20 77 69 74 68 69 6e |of field|s within|
|000022c0| 20 61 20 52 65 63 74 20 | 2a 2f 0d 23 64 65 66 69 | a Rect |*/.#defi|
|000022d0| 6e 65 20 54 6f 70 4c 65 | 66 74 28 61 52 65 63 74 |ne TopLe|ft(aRect|
|000022e0| 29 09 28 2a 20 28 50 6f | 69 6e 74 20 2a 29 20 26 |).(* (Po|int *) &|
|000022f0| 28 61 52 65 63 74 29 2e | 74 6f 70 29 0d 23 64 65 |(aRect).|top).#de|
|00002300| 66 69 6e 65 20 42 6f 74 | 52 69 67 68 74 28 61 52 |fine Bot|Right(aR|
|00002310| 65 63 74 29 09 28 2a 20 | 28 50 6f 69 6e 74 20 2a |ect).(* |(Point *|
|00002320| 29 20 26 28 61 52 65 63 | 74 29 2e 62 6f 74 74 6f |) &(aRec|t).botto|
|00002330| 6d 29 0d 0d 0d 2f 2a 20 | 54 68 69 73 20 72 6f 75 |m).../* |This rou|
|00002340| 74 69 6e 65 20 69 73 20 | 70 61 72 74 20 6f 66 20 |tine is |part of |
|00002350| 74 68 65 20 4d 50 57 20 | 72 75 6e 74 69 6d 65 20 |the MPW |runtime |
|00002360| 6c 69 62 72 61 72 79 2e | 20 54 68 69 73 20 65 78 |library.| This ex|
|00002370| 74 65 72 6e 61 6c 0d 20 | 20 20 72 65 66 65 72 65 |ternal. | refere|
|00002380| 6e 63 65 20 74 6f 20 69 | 74 20 69 73 20 64 6f 6e |nce to i|t is don|
|00002390| 65 20 73 6f 20 74 68 61 | 74 20 77 65 20 63 61 6e |e so tha|t we can|
|000023a0| 20 75 6e 6c 6f 61 64 20 | 69 74 73 20 73 65 67 6d | unload |its segm|
|000023b0| 65 6e 74 2c 20 25 41 35 | 49 6e 69 74 2e 20 2a 2f |ent, %A5|Init. */|
|000023c0| 0d 0d 23 69 66 6e 64 65 | 66 20 41 55 58 0d 20 20 |..#ifnde|f AUX. |
|000023d0| 65 78 74 65 72 6e 20 76 | 6f 69 64 20 5f 44 61 74 |extern v|oid _Dat|
|000023e0| 61 49 6e 69 74 28 29 3b | 0d 23 65 6e 64 69 66 0d |aInit();|.#endif.|
|000023f0| 0d 0d 2f 2a 20 41 20 72 | 65 66 65 72 65 6e 63 65 |../* A r|eference|
|00002400| 20 74 6f 20 6f 75 72 20 | 61 73 73 65 6d 62 6c 79 | to our |assembly|
|00002410| 20 6c 61 6e 67 75 61 67 | 65 20 72 6f 75 74 69 6e | languag|e routin|
|00002420| 65 20 74 68 61 74 20 67 | 65 74 73 20 61 74 74 61 |e that g|ets atta|
|00002430| 63 68 65 64 20 74 6f 20 | 74 68 65 20 63 6c 69 6b |ched to |the clik|
|00002440| 4c 6f 6f 70 0d 66 69 65 | 6c 64 20 6f 66 20 6f 75 |Loop.fie|ld of ou|
|00002450| 72 20 54 45 20 72 65 63 | 6f 72 64 2e 20 2a 2f 0d |r TE rec|ord. */.|
|00002460| 0d 23 69 66 64 65 66 20 | 41 55 58 0d 65 78 74 65 |.#ifdef |AUX.exte|
|00002470| 72 6e 20 76 6f 69 64 20 | 41 73 6d 43 6c 69 6b 4c |rn void |AsmClikL|
|00002480| 6f 6f 70 28 29 3b 0d 23 | 65 6c 73 65 0d 65 78 74 |oop();.#|else.ext|
|00002490| 65 72 6e 20 70 61 73 63 | 61 6c 20 76 6f 69 64 20 |ern pasc|al void |
|000024a0| 41 73 6d 43 6c 69 6b 4c | 6f 6f 70 28 29 3b 0d 23 |AsmClikL|oop();.#|
|000024b0| 65 6e 64 69 66 0d 0d 0d | 23 70 72 61 67 6d 61 20 |endif...|#pragma |
|000024c0| 73 65 67 6d 65 6e 74 20 | 4d 61 69 6e 0d 6d 61 69 |segment |Main.mai|
|000024d0| 6e 28 29 0d 7b 0d 23 69 | 66 6e 64 65 66 20 41 55 |n().{.#i|fndef AU|
|000024e0| 58 0d 09 55 6e 6c 6f 61 | 64 53 65 67 28 28 50 74 |X..Unloa|dSeg((Pt|
|000024f0| 72 29 20 5f 44 61 74 61 | 49 6e 69 74 29 3b 09 09 |r) _Data|Init);..|
|00002500| 2f 2a 20 6e 6f 74 65 20 | 74 68 61 74 20 5f 44 61 |/* note |that _Da|
|00002510| 74 61 49 6e 69 74 20 6d | 75 73 74 20 6e 6f 74 20 |taInit m|ust not |
|00002520| 62 65 20 69 6e 20 4d 61 | 69 6e 21 20 2a 2f 0d 23 |be in Ma|in! */.#|
|00002530| 65 6e 64 69 66 0d 09 0d | 09 2f 2a 20 31 2e 30 31 |endif...|./* 1.01|
|00002540| 20 2d 20 63 61 6c 6c 20 | 74 6f 20 46 6f 72 63 65 | - call |to Force|
|00002550| 45 6e 76 69 72 6f 6e 73 | 20 72 65 6d 6f 76 65 64 |Environs| removed|
|00002560| 20 2a 2f 0d 09 0d 09 2f | 2a 09 49 66 20 79 6f 75 | */..../|*.If you|
|00002570| 20 68 61 76 65 20 73 74 | 61 63 6b 20 72 65 71 75 | have st|ack requ|
|00002580| 69 72 65 6d 65 6e 74 73 | 20 74 68 61 74 20 64 69 |irements| that di|
|00002590| 66 66 65 72 20 66 72 6f | 6d 20 74 68 65 20 64 65 |ffer fro|m the de|
|000025a0| 66 61 75 6c 74 2c 0d 09 | 09 74 68 65 6e 20 79 6f |fault,..|.then yo|
|000025b0| 75 20 63 6f 75 6c 64 20 | 75 73 65 20 53 65 74 41 |u could |use SetA|
|000025c0| 70 70 6c 4c 69 6d 69 74 | 20 74 6f 20 69 6e 63 72 |pplLimit| to incr|
|000025d0| 65 61 73 65 20 53 74 61 | 63 6b 53 70 61 63 65 20 |ease Sta|ckSpace |
|000025e0| 61 74 20 0d 09 09 74 68 | 69 73 20 70 6f 69 6e 74 |at ...th|is point|
|000025f0| 2c 20 62 65 66 6f 72 65 | 20 63 61 6c 6c 69 6e 67 |, before| calling|
|00002600| 20 4d 61 78 41 70 70 6c | 5a 6f 6e 65 2e 20 2a 2f | MaxAppl|Zone. */|
|00002610| 0d 09 4d 61 78 41 70 70 | 6c 5a 6f 6e 65 28 29 3b |..MaxApp|lZone();|
|00002620| 09 09 09 09 09 2f 2a 20 | 65 78 70 61 6e 64 20 74 |...../* |expand t|
|00002630| 68 65 20 68 65 61 70 20 | 73 6f 20 63 6f 64 65 20 |he heap |so code |
|00002640| 73 65 67 6d 65 6e 74 73 | 20 6c 6f 61 64 20 61 74 |segments| load at|
|00002650| 20 74 68 65 20 74 6f 70 | 20 2a 2f 0d 0d 09 49 6e | the top| */...In|
|00002660| 69 74 69 61 6c 69 7a 65 | 28 29 3b 09 09 09 09 09 |itialize|();.....|
|00002670| 2f 2a 20 69 6e 69 74 69 | 61 6c 69 7a 65 20 74 68 |/* initi|alize th|
|00002680| 65 20 70 72 6f 67 72 61 | 6d 20 2a 2f 0d 23 69 66 |e progra|m */.#if|
|00002690| 6e 64 65 66 20 41 55 58 | 0d 09 55 6e 6c 6f 61 64 |ndef AUX|..Unload|
|000026a0| 53 65 67 28 28 50 74 72 | 29 20 49 6e 69 74 69 61 |Seg((Ptr|) Initia|
|000026b0| 6c 69 7a 65 29 3b 09 2f | 2a 20 6e 6f 74 65 20 74 |lize);./|* note t|
|000026c0| 68 61 74 20 49 6e 69 74 | 69 61 6c 69 7a 65 20 6d |hat Init|ialize m|
|000026d0| 75 73 74 20 6e 6f 74 20 | 62 65 20 69 6e 20 4d 61 |ust not |be in Ma|
|000026e0| 69 6e 21 20 2a 2f 0d 23 | 65 6e 64 69 66 0d 0d 09 |in! */.#|endif...|
|000026f0| 45 76 65 6e 74 4c 6f 6f | 70 28 29 3b 09 09 09 09 |EventLoo|p();....|
|00002700| 09 2f 2a 20 63 61 6c 6c | 20 74 68 65 20 6d 61 69 |./* call| the mai|
|00002710| 6e 20 65 76 65 6e 74 20 | 6c 6f 6f 70 20 2a 2f 0d |n event |loop */.|
|00002720| 7d 0d 0d 0d 2f 2a 20 47 | 65 74 20 65 76 65 6e 74 |}.../* G|et event|
|00002730| 73 20 66 6f 72 65 76 65 | 72 2c 20 61 6e 64 20 68 |s foreve|r, and h|
|00002740| 61 6e 64 6c 65 20 74 68 | 65 6d 20 62 79 20 63 61 |andle th|em by ca|
|00002750| 6c 6c 69 6e 67 20 44 6f | 45 76 65 6e 74 2e 0d 20 |lling Do|Event.. |
|00002760| 20 20 41 6c 73 6f 20 63 | 61 6c 6c 20 41 64 6a 75 | Also c|all Adju|
|00002770| 73 74 43 75 72 73 6f 72 | 20 65 61 63 68 20 74 69 |stCursor| each ti|
|00002780| 6d 65 20 74 68 72 6f 75 | 67 68 20 74 68 65 20 6c |me throu|gh the l|
|00002790| 6f 6f 70 2e 20 2a 2f 0d | 0d 23 70 72 61 67 6d 61 |oop. */.|.#pragma|
|000027a0| 20 73 65 67 6d 65 6e 74 | 20 4d 61 69 6e 0d 76 6f | segment| Main.vo|
|000027b0| 69 64 20 45 76 65 6e 74 | 4c 6f 6f 70 28 29 0d 7b |id Event|Loop().{|
|000027c0| 0d 09 52 67 6e 48 61 6e | 64 6c 65 09 63 75 72 73 |..RgnHan|dle.curs|
|000027d0| 6f 72 52 67 6e 3b 0d 09 | 42 6f 6f 6c 65 61 6e 09 |orRgn;..|Boolean.|
|000027e0| 09 67 6f 74 45 76 65 6e | 74 3b 0d 09 45 76 65 6e |.gotEven|t;..Even|
|000027f0| 74 52 65 63 6f 72 64 09 | 65 76 65 6e 74 3b 0d 09 |tRecord.|event;..|
|00002800| 50 6f 69 6e 74 09 09 6d | 6f 75 73 65 3b 0d 0d 09 |Point..m|ouse;...|
|00002810| 63 75 72 73 6f 72 52 67 | 6e 20 3d 20 4e 65 77 52 |cursorRg|n = NewR|
|00002820| 67 6e 28 29 3b 09 09 09 | 2f 2a 20 77 65 d5 6c 6c |gn();...|/* we.ll|
|00002830| 20 70 61 73 73 20 57 4e | 45 20 61 6e 20 65 6d 70 | pass WN|E an emp|
|00002840| 74 79 20 72 65 67 69 6f | 6e 20 74 68 65 20 31 73 |ty regio|n the 1s|
|00002850| 74 20 74 69 6d 65 20 74 | 68 72 75 20 2a 2f 0d 09 |t time t|hru */..|
|00002860| 64 6f 20 7b 0d 09 09 2f | 2a 20 75 73 65 20 57 4e |do {.../|* use WN|
|00002870| 45 20 69 66 20 69 74 20 | 69 73 20 61 76 61 69 6c |E if it |is avail|
|00002880| 61 62 6c 65 20 2a 2f 0d | 09 09 69 66 20 28 20 67 |able */.|..if ( g|
|00002890| 48 61 73 57 61 69 74 4e | 65 78 74 45 76 65 6e 74 |HasWaitN|extEvent|
|000028a0| 20 29 20 7b 0d 09 09 09 | 47 65 74 47 6c 6f 62 61 | ) {....|GetGloba|
|000028b0| 6c 4d 6f 75 73 65 28 26 | 6d 6f 75 73 65 29 3b 0d |lMouse(&|mouse);.|
|000028c0| 09 09 09 41 64 6a 75 73 | 74 43 75 72 73 6f 72 28 |...Adjus|tCursor(|
|000028d0| 6d 6f 75 73 65 2c 20 63 | 75 72 73 6f 72 52 67 6e |mouse, c|ursorRgn|
|000028e0| 29 3b 0d 09 09 09 67 6f | 74 45 76 65 6e 74 20 3d |);....go|tEvent =|
|000028f0| 20 57 61 69 74 4e 65 78 | 74 45 76 65 6e 74 28 65 | WaitNex|tEvent(e|
|00002900| 76 65 72 79 45 76 65 6e | 74 2c 20 26 65 76 65 6e |veryEven|t, &even|
|00002910| 74 2c 20 47 65 74 53 6c | 65 65 70 28 29 2c 20 63 |t, GetSl|eep(), c|
|00002920| 75 72 73 6f 72 52 67 6e | 29 3b 0d 09 09 7d 0d 09 |ursorRgn|);...}..|
|00002930| 09 65 6c 73 65 20 7b 0d | 09 09 09 53 79 73 74 65 |.else {.|...Syste|
|00002940| 6d 54 61 73 6b 28 29 3b | 0d 09 09 09 67 6f 74 45 |mTask();|....gotE|
|00002950| 76 65 6e 74 20 3d 20 47 | 65 74 4e 65 78 74 45 76 |vent = G|etNextEv|
|00002960| 65 6e 74 28 65 76 65 72 | 79 45 76 65 6e 74 2c 20 |ent(ever|yEvent, |
|00002970| 26 65 76 65 6e 74 29 3b | 0d 09 09 7d 0d 09 09 69 |&event);|...}...i|
|00002980| 66 20 28 20 67 6f 74 45 | 76 65 6e 74 20 29 20 7b |f ( gotE|vent ) {|
|00002990| 0d 09 09 09 2f 2a 20 6d | 61 6b 65 20 73 75 72 65 |..../* m|ake sure|
|000029a0| 20 77 65 20 68 61 76 65 | 20 74 68 65 20 72 69 67 | we have| the rig|
|000029b0| 68 74 20 63 75 72 73 6f | 72 20 62 65 66 6f 72 65 |ht curso|r before|
|000029c0| 20 68 61 6e 64 6c 69 6e | 67 20 74 68 65 20 65 76 | handlin|g the ev|
|000029d0| 65 6e 74 20 2a 2f 0d 09 | 09 09 41 64 6a 75 73 74 |ent */..|..Adjust|
|000029e0| 43 75 72 73 6f 72 28 65 | 76 65 6e 74 2e 77 68 65 |Cursor(e|vent.whe|
|000029f0| 72 65 2c 20 63 75 72 73 | 6f 72 52 67 6e 29 3b 0d |re, curs|orRgn);.|
|00002a00| 09 09 09 44 6f 45 76 65 | 6e 74 28 26 65 76 65 6e |...DoEve|nt(&even|
|00002a10| 74 29 3b 0d 09 09 7d 0d | 09 09 65 6c 73 65 0d 09 |t);...}.|..else..|
|00002a20| 09 09 44 6f 49 64 6c 65 | 28 29 3b 09 09 09 09 2f |..DoIdle|();..../|
|00002a30| 2a 20 70 65 72 66 6f 72 | 6d 20 69 64 6c 65 20 74 |* perfor|m idle t|
|00002a40| 61 73 6b 73 20 77 68 65 | 6e 20 69 74 d5 73 20 6e |asks whe|n it.s n|
|00002a50| 6f 74 20 6f 75 72 20 65 | 76 65 6e 74 20 2a 2f 0d |ot our e|vent */.|
|00002a60| 09 09 2f 2a 09 49 66 20 | 79 6f 75 20 61 72 65 20 |../*.If |you are |
|00002a70| 75 73 69 6e 67 20 6d 6f | 64 65 6c 65 73 73 20 64 |using mo|deless d|
|00002a80| 69 61 6c 6f 67 73 20 74 | 68 61 74 20 68 61 76 65 |ialogs t|hat have|
|00002a90| 20 65 64 69 74 54 65 78 | 74 20 69 74 65 6d 73 2c | editTex|t items,|
|00002aa0| 0d 09 09 09 79 6f 75 20 | 77 69 6c 6c 20 77 61 6e |....you |will wan|
|00002ab0| 74 20 74 6f 20 63 61 6c | 6c 20 49 73 44 69 61 6c |t to cal|l IsDial|
|00002ac0| 6f 67 45 76 65 6e 74 20 | 74 6f 20 67 69 76 65 20 |ogEvent |to give |
|00002ad0| 74 68 65 20 63 61 72 65 | 74 20 61 20 63 68 61 6e |the care|t a chan|
|00002ae0| 63 65 0d 09 09 09 74 6f | 20 62 6c 69 6e 6b 2c 20 |ce....to| blink, |
|00002af0| 65 76 65 6e 20 69 66 20 | 57 4e 45 2f 47 4e 45 20 |even if |WNE/GNE |
|00002b00| 72 65 74 75 72 6e 65 64 | 20 46 41 4c 53 45 2e 20 |returned| FALSE. |
|00002b10| 48 6f 77 65 76 65 72 2c | 20 63 68 65 63 6b 20 46 |However,| check F|
|00002b20| 72 6f 6e 74 57 69 6e 64 | 6f 77 0d 09 09 09 66 6f |rontWind|ow....fo|
|00002b30| 72 20 61 20 6e 6f 6e 2d | 4e 49 4c 20 76 61 6c 75 |r a non-|NIL valu|
|00002b40| 65 20 62 65 66 6f 72 65 | 20 63 61 6c 6c 69 6e 67 |e before| calling|
|00002b50| 20 49 73 44 69 61 6c 6f | 67 45 76 65 6e 74 2e 20 | IsDialo|gEvent. |
|00002b60| 2a 2f 0d 09 7d 20 77 68 | 69 6c 65 20 28 20 74 72 |*/..} wh|ile ( tr|
|00002b70| 75 65 20 29 3b 09 2f 2a | 20 6c 6f 6f 70 20 66 6f |ue );./*| loop fo|
|00002b80| 72 65 76 65 72 3b 20 77 | 65 20 71 75 69 74 20 76 |rever; w|e quit v|
|00002b90| 69 61 20 45 78 69 74 54 | 6f 53 68 65 6c 6c 20 2a |ia ExitT|oShell *|
|00002ba0| 2f 0d 7d 20 2f 2a 45 76 | 65 6e 74 4c 6f 6f 70 2a |/.} /*Ev|entLoop*|
|00002bb0| 2f 0d 0d 0d 2f 2a 20 44 | 6f 20 74 68 65 20 72 69 |/.../* D|o the ri|
|00002bc0| 67 68 74 20 74 68 69 6e | 67 20 66 6f 72 20 61 6e |ght thin|g for an|
|00002bd0| 20 65 76 65 6e 74 2e 20 | 44 65 74 65 72 6d 69 6e | event. |Determin|
|00002be0| 65 20 77 68 61 74 20 6b | 69 6e 64 20 6f 66 20 65 |e what k|ind of e|
|00002bf0| 76 65 6e 74 20 69 74 20 | 69 73 2c 20 61 6e 64 20 |vent it |is, and |
|00002c00| 63 61 6c 6c 0d 20 74 68 | 65 20 61 70 70 72 6f 70 |call. th|e approp|
|00002c10| 72 69 61 74 65 20 72 6f | 75 74 69 6e 65 73 2e 20 |riate ro|utines. |
|00002c20| 2a 2f 0d 0d 23 70 72 61 | 67 6d 61 20 73 65 67 6d |*/..#pra|gma segm|
|00002c30| 65 6e 74 20 4d 61 69 6e | 0d 76 6f 69 64 20 44 6f |ent Main|.void Do|
|00002c40| 45 76 65 6e 74 28 65 76 | 65 6e 74 29 0d 09 45 76 |Event(ev|ent)..Ev|
|00002c50| 65 6e 74 52 65 63 6f 72 | 64 09 2a 65 76 65 6e 74 |entRecor|d.*event|
|00002c60| 3b 0d 7b 0d 09 73 68 6f | 72 74 09 09 70 61 72 74 |;.{..sho|rt..part|
|00002c70| 2c 20 65 72 72 3b 0d 09 | 57 69 6e 64 6f 77 50 74 |, err;..|WindowPt|
|00002c80| 72 09 77 69 6e 64 6f 77 | 3b 0d 09 63 68 61 72 09 |r.window|;..char.|
|00002c90| 09 6b 65 79 3b 0d 09 50 | 6f 69 6e 74 09 09 61 50 |.key;..P|oint..aP|
|00002ca0| 6f 69 6e 74 3b 0d 0d 09 | 73 77 69 74 63 68 20 28 |oint;...|switch (|
|00002cb0| 20 65 76 65 6e 74 2d 3e | 77 68 61 74 20 29 20 7b | event->|what ) {|
|00002cc0| 0d 09 09 63 61 73 65 20 | 6e 75 6c 6c 45 76 65 6e |...case |nullEven|
|00002cd0| 74 3a 0d 09 09 09 2f 2a | 20 77 65 20 69 64 6c 65 |t:..../*| we idle|
|00002ce0| 20 66 6f 72 20 6e 75 6c | 6c 2f 6d 6f 75 73 65 20 | for nul|l/mouse |
|00002cf0| 6d 6f 76 65 64 20 65 76 | 65 6e 74 73 20 61 6e 64 |moved ev|ents and|
|00002d00| 73 20 66 6f 72 20 65 76 | 65 6e 74 73 20 77 68 69 |s for ev|ents whi|
|00002d10| 63 68 20 61 72 65 6e d5 | 74 0d 09 09 09 09 6f 75 |ch aren.|t.....ou|
|00002d20| 72 73 20 28 73 65 65 20 | 45 76 65 6e 74 4c 6f 6f |rs (see |EventLoo|
|00002d30| 70 29 20 2a 2f 0d 09 09 | 09 44 6f 49 64 6c 65 28 |p) */...|.DoIdle(|
|00002d40| 29 3b 0d 09 09 09 62 72 | 65 61 6b 3b 0d 09 09 63 |);....br|eak;...c|
|00002d50| 61 73 65 20 6d 6f 75 73 | 65 44 6f 77 6e 3a 0d 09 |ase mous|eDown:..|
|00002d60| 09 09 70 61 72 74 20 3d | 20 46 69 6e 64 57 69 6e |..part =| FindWin|
|00002d70| 64 6f 77 28 65 76 65 6e | 74 2d 3e 77 68 65 72 65 |dow(even|t->where|
|00002d80| 2c 20 26 77 69 6e 64 6f | 77 29 3b 0d 09 09 09 73 |, &windo|w);....s|
|00002d90| 77 69 74 63 68 20 28 20 | 70 61 72 74 20 29 20 7b |witch ( |part ) {|
|00002da0| 0d 09 09 09 09 63 61 73 | 65 20 69 6e 4d 65 6e 75 |.....cas|e inMenu|
|00002db0| 42 61 72 3a 20 20 20 20 | 20 20 20 20 20 20 20 20 |Bar: | |
|00002dc0| 20 2f 2a 20 70 72 6f 63 | 65 73 73 20 61 20 6d 6f | /* proc|ess a mo|
|00002dd0| 75 73 65 20 6d 65 6e 75 | 20 63 6f 6d 6d 61 6e 64 |use menu| command|
|00002de0| 20 28 69 66 20 61 6e 79 | 29 20 2a 2f 0d 09 09 09 | (if any|) */....|
|00002df0| 09 09 41 64 6a 75 73 74 | 4d 65 6e 75 73 28 29 3b |..Adjust|Menus();|
|00002e00| 09 2f 2a 20 62 72 69 6e | 67 20 d5 65 6d 20 75 70 |./* brin|g .em up|
|00002e10| 2d 74 6f 2d 64 61 74 65 | 20 2a 2f 0d 09 09 09 09 |-to-date| */.....|
|00002e20| 09 44 6f 4d 65 6e 75 43 | 6f 6d 6d 61 6e 64 28 4d |.DoMenuC|ommand(M|
|00002e30| 65 6e 75 53 65 6c 65 63 | 74 28 65 76 65 6e 74 2d |enuSelec|t(event-|
|00002e40| 3e 77 68 65 72 65 29 29 | 3b 0d 09 09 09 09 09 62 |>where))|;......b|
|00002e50| 72 65 61 6b 3b 0d 09 09 | 09 09 63 61 73 65 20 69 |reak;...|..case i|
|00002e60| 6e 53 79 73 57 69 6e 64 | 6f 77 3a 20 20 20 20 20 |nSysWind|ow: |
|00002e70| 20 20 20 20 20 20 2f 2a | 20 6c 65 74 20 74 68 65 | /*| let the|
|00002e80| 20 73 79 73 74 65 6d 20 | 68 61 6e 64 6c 65 20 74 | system |handle t|
|00002e90| 68 65 20 6d 6f 75 73 65 | 44 6f 77 6e 20 2a 2f 0d |he mouse|Down */.|
|00002ea0| 09 09 09 09 09 53 79 73 | 74 65 6d 43 6c 69 63 6b |.....Sys|temClick|
|00002eb0| 28 65 76 65 6e 74 2c 20 | 77 69 6e 64 6f 77 29 3b |(event, |window);|
|00002ec0| 0d 09 09 09 09 09 62 72 | 65 61 6b 3b 0d 09 09 09 |......br|eak;....|
|00002ed0| 09 63 61 73 65 20 69 6e | 43 6f 6e 74 65 6e 74 3a |.case in|Content:|
|00002ee0| 0d 09 09 09 09 09 69 66 | 20 28 20 77 69 6e 64 6f |......if| ( windo|
|00002ef0| 77 20 21 3d 20 46 72 6f | 6e 74 57 69 6e 64 6f 77 |w != Fro|ntWindow|
|00002f00| 28 29 20 29 20 7b 0d 09 | 09 09 09 09 09 53 65 6c |() ) {..|.....Sel|
|00002f10| 65 63 74 57 69 6e 64 6f | 77 28 77 69 6e 64 6f 77 |ectWindo|w(window|
|00002f20| 29 3b 0d 09 09 09 09 09 | 09 2f 2a 44 6f 45 76 65 |);......|./*DoEve|
|00002f30| 6e 74 28 65 76 65 6e 74 | 29 3b 2a 2f 09 2f 2a 20 |nt(event|);*/./* |
|00002f40| 75 73 65 20 74 68 69 73 | 20 6c 69 6e 65 20 66 6f |use this| line fo|
|00002f50| 72 20 22 64 6f 20 66 69 | 72 73 74 20 63 6c 69 63 |r "do fi|rst clic|
|00002f60| 6b 22 20 2a 2f 0d 09 09 | 09 09 09 7d 20 65 6c 73 |k" */...|...} els|
|00002f70| 65 0d 09 09 09 09 09 09 | 44 6f 43 6f 6e 74 65 6e |e.......|DoConten|
|00002f80| 74 43 6c 69 63 6b 28 77 | 69 6e 64 6f 77 2c 20 65 |tClick(w|indow, e|
|00002f90| 76 65 6e 74 29 3b 0d 09 | 09 09 09 09 62 72 65 61 |vent);..|....brea|
|00002fa0| 6b 3b 0d 09 09 09 09 63 | 61 73 65 20 69 6e 44 72 |k;.....c|ase inDr|
|00002fb0| 61 67 3a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |ag: | |
|00002fc0| 20 20 20 2f 2a 20 70 61 | 73 73 20 73 63 72 65 65 | /* pa|ss scree|
|00002fd0| 6e 42 69 74 73 2e 62 6f | 75 6e 64 73 20 74 6f 20 |nBits.bo|unds to |
|00002fe0| 67 65 74 20 61 6c 6c 20 | 67 44 65 76 69 63 65 73 |get all |gDevices|
|00002ff0| 20 2a 2f 0d 09 09 09 09 | 09 44 72 61 67 57 69 6e | */.....|.DragWin|
|00003000| 64 6f 77 28 77 69 6e 64 | 6f 77 2c 20 65 76 65 6e |dow(wind|ow, even|
|00003010| 74 2d 3e 77 68 65 72 65 | 2c 20 26 71 64 2e 73 63 |t->where|, &qd.sc|
|00003020| 72 65 65 6e 42 69 74 73 | 2e 62 6f 75 6e 64 73 29 |reenBits|.bounds)|
|00003030| 3b 0d 09 09 09 09 09 62 | 72 65 61 6b 3b 0d 09 09 |;......b|reak;...|
|00003040| 09 09 63 61 73 65 20 69 | 6e 47 6f 41 77 61 79 3a |..case i|nGoAway:|
|00003050| 0d 09 09 09 09 09 69 66 | 20 28 20 54 72 61 63 6b |......if| ( Track|
|00003060| 47 6f 41 77 61 79 28 77 | 69 6e 64 6f 77 2c 20 65 |GoAway(w|indow, e|
|00003070| 76 65 6e 74 2d 3e 77 68 | 65 72 65 29 20 29 0d 09 |vent->wh|ere) )..|
|00003080| 09 09 09 09 09 44 6f 43 | 6c 6f 73 65 57 69 6e 64 |.....DoC|loseWind|
|00003090| 6f 77 28 77 69 6e 64 6f | 77 29 3b 20 2f 2a 20 77 |ow(windo|w); /* w|
|000030a0| 65 20 64 6f 6e d5 74 20 | 63 61 72 65 20 69 66 20 |e don.t |care if |
|000030b0| 74 68 65 20 75 73 65 72 | 20 63 61 6e 63 65 6c 6c |the user| cancell|
|000030c0| 65 64 20 2a 2f 0d 09 09 | 09 09 09 62 72 65 61 6b |ed */...|...break|
|000030d0| 3b 0d 09 09 09 09 63 61 | 73 65 20 69 6e 47 72 6f |;.....ca|se inGro|
|000030e0| 77 3a 0d 09 09 09 09 09 | 44 6f 47 72 6f 77 57 69 |w:......|DoGrowWi|
|000030f0| 6e 64 6f 77 28 77 69 6e | 64 6f 77 2c 20 65 76 65 |ndow(win|dow, eve|
|00003100| 6e 74 29 3b 0d 09 09 09 | 09 09 62 72 65 61 6b 3b |nt);....|..break;|
|00003110| 0d 09 09 09 09 63 61 73 | 65 20 69 6e 5a 6f 6f 6d |.....cas|e inZoom|
|00003120| 49 6e 3a 0d 09 09 09 09 | 63 61 73 65 20 69 6e 5a |In:.....|case inZ|
|00003130| 6f 6f 6d 4f 75 74 3a 0d | 09 09 09 09 69 66 20 28 |oomOut:.|....if (|
|00003140| 20 54 72 61 63 6b 42 6f | 78 28 77 69 6e 64 6f 77 | TrackBo|x(window|
|00003150| 2c 20 65 76 65 6e 74 2d | 3e 77 68 65 72 65 2c 20 |, event-|>where, |
|00003160| 70 61 72 74 29 20 29 0d | 09 09 09 09 09 09 44 6f |part) ).|......Do|
|00003170| 5a 6f 6f 6d 57 69 6e 64 | 6f 77 28 77 69 6e 64 6f |ZoomWind|ow(windo|
|00003180| 77 2c 20 70 61 72 74 29 | 3b 0d 09 09 09 09 09 62 |w, part)|;......b|
|00003190| 72 65 61 6b 3b 0d 09 09 | 09 7d 0d 09 09 09 62 72 |reak;...|.}....br|
|000031a0| 65 61 6b 3b 0d 09 09 63 | 61 73 65 20 6b 65 79 44 |eak;...c|ase keyD|
|000031b0| 6f 77 6e 3a 0d 09 09 63 | 61 73 65 20 61 75 74 6f |own:...c|ase auto|
|000031c0| 4b 65 79 3a 20 20 20 20 | 20 20 20 20 20 20 20 20 |Key: | |
|000031d0| 20 20 20 20 20 20 20 20 | 20 20 20 2f 2a 20 63 68 | | /* ch|
|000031e0| 65 63 6b 20 66 6f 72 20 | 6d 65 6e 75 6b 65 79 20 |eck for |menukey |
|000031f0| 65 71 75 69 76 61 6c 65 | 6e 74 73 20 2a 2f 0d 09 |equivale|nts */..|
|00003200| 09 09 6b 65 79 20 3d 20 | 65 76 65 6e 74 2d 3e 6d |..key = |event->m|
|00003210| 65 73 73 61 67 65 20 26 | 20 63 68 61 72 43 6f 64 |essage &| charCod|
|00003220| 65 4d 61 73 6b 3b 0d 09 | 09 09 69 66 20 28 20 65 |eMask;..|..if ( e|
|00003230| 76 65 6e 74 2d 3e 6d 6f | 64 69 66 69 65 72 73 20 |vent->mo|difiers |
|00003240| 26 20 63 6d 64 4b 65 79 | 20 29 20 7b 09 2f 2a 20 |& cmdKey| ) {./* |
|00003250| 43 6f 6d 6d 61 6e 64 20 | 6b 65 79 20 64 6f 77 6e |Command |key down|
|00003260| 20 2a 2f 0d 09 09 09 09 | 69 66 20 28 20 65 76 65 | */.....|if ( eve|
|00003270| 6e 74 2d 3e 77 68 61 74 | 20 3d 3d 20 6b 65 79 44 |nt->what| == keyD|
|00003280| 6f 77 6e 20 29 20 7b 0d | 09 09 09 09 09 41 64 6a |own ) {.|.....Adj|
|00003290| 75 73 74 4d 65 6e 75 73 | 28 29 3b 09 09 09 2f 2a |ustMenus|();.../*|
|000032a0| 20 65 6e 61 62 6c 65 2f | 64 69 73 61 62 6c 65 2f | enable/|disable/|
|000032b0| 63 68 65 63 6b 20 6d 65 | 6e 75 20 69 74 65 6d 73 |check me|nu items|
|000032c0| 20 70 72 6f 70 65 72 6c | 79 20 2a 2f 0d 09 09 09 | properl|y */....|
|000032d0| 09 09 44 6f 4d 65 6e 75 | 43 6f 6d 6d 61 6e 64 28 |..DoMenu|Command(|
|000032e0| 4d 65 6e 75 4b 65 79 28 | 6b 65 79 29 29 3b 0d 09 |MenuKey(|key));..|
|000032f0| 09 09 09 7d 0d 09 09 09 | 7d 20 65 6c 73 65 0d 09 |...}....|} else..|
|00003300| 09 09 09 44 6f 4b 65 79 | 44 6f 77 6e 28 65 76 65 |...DoKey|Down(eve|
|00003310| 6e 74 29 3b 0d 09 09 09 | 62 72 65 61 6b 3b 0d 09 |nt);....|break;..|
|00003320| 09 63 61 73 65 20 61 63 | 74 69 76 61 74 65 45 76 |.case ac|tivateEv|
|00003330| 74 3a 0d 09 09 09 44 6f | 41 63 74 69 76 61 74 65 |t:....Do|Activate|
|00003340| 28 28 57 69 6e 64 6f 77 | 50 74 72 29 20 65 76 65 |((Window|Ptr) eve|
|00003350| 6e 74 2d 3e 6d 65 73 73 | 61 67 65 2c 20 28 65 76 |nt->mess|age, (ev|
|00003360| 65 6e 74 2d 3e 6d 6f 64 | 69 66 69 65 72 73 20 26 |ent->mod|ifiers &|
|00003370| 20 61 63 74 69 76 65 46 | 6c 61 67 29 20 21 3d 20 | activeF|lag) != |
|00003380| 30 29 3b 0d 09 09 09 62 | 72 65 61 6b 3b 0d 09 09 |0);....b|reak;...|
|00003390| 63 61 73 65 20 75 70 64 | 61 74 65 45 76 74 3a 0d |case upd|ateEvt:.|
|000033a0| 09 09 09 44 6f 55 70 64 | 61 74 65 28 28 57 69 6e |...DoUpd|ate((Win|
|000033b0| 64 6f 77 50 74 72 29 20 | 65 76 65 6e 74 2d 3e 6d |dowPtr) |event->m|
|000033c0| 65 73 73 61 67 65 29 3b | 0d 09 09 09 62 72 65 61 |essage);|....brea|
|000033d0| 6b 3b 0d 09 09 2f 2a 09 | 31 2e 30 31 20 2d 20 49 |k;.../*.|1.01 - I|
|000033e0| 74 20 69 73 20 6e 6f 74 | 20 61 20 62 61 64 20 69 |t is not| a bad i|
|000033f0| 64 65 61 20 74 6f 20 61 | 74 20 6c 65 61 73 74 20 |dea to a|t least |
|00003400| 63 61 6c 6c 20 44 49 42 | 61 64 4d 6f 75 6e 74 20 |call DIB|adMount |
|00003410| 69 6e 20 72 65 73 70 6f | 6e 73 65 0d 09 09 09 74 |in respo|nse....t|
|00003420| 6f 20 61 20 64 69 73 6b | 45 76 74 2c 20 73 6f 20 |o a disk|Evt, so |
|00003430| 74 68 61 74 20 74 68 65 | 20 75 73 65 72 20 63 61 |that the| user ca|
|00003440| 6e 20 66 6f 72 6d 61 74 | 20 61 20 66 6c 6f 70 70 |n format| a flopp|
|00003450| 79 2e 20 2a 2f 0d 09 09 | 63 61 73 65 20 64 69 73 |y. */...|case dis|
|00003460| 6b 45 76 74 3a 0d 23 69 | 66 6e 64 65 66 20 41 55 |kEvt:.#i|fndef AU|
|00003470| 58 0d 09 09 09 69 66 20 | 28 20 48 69 57 6f 72 64 |X....if |( HiWord|
|00003480| 28 65 76 65 6e 74 2d 3e | 6d 65 73 73 61 67 65 29 |(event->|message)|
|00003490| 20 21 3d 20 6e 6f 45 72 | 72 20 29 20 7b 0d 09 09 | != noEr|r ) {...|
|000034a0| 09 09 53 65 74 50 74 28 | 26 61 50 6f 69 6e 74 2c |..SetPt(|&aPoint,|
|000034b0| 20 6b 44 49 4c 65 66 74 | 2c 20 6b 44 49 54 6f 70 | kDILeft|, kDITop|
|000034c0| 29 3b 0d 09 09 09 09 65 | 72 72 20 3d 20 44 49 42 |);.....e|rr = DIB|
|000034d0| 61 64 4d 6f 75 6e 74 28 | 61 50 6f 69 6e 74 2c 20 |adMount(|aPoint, |
|000034e0| 65 76 65 6e 74 2d 3e 6d | 65 73 73 61 67 65 29 3b |event->m|essage);|
|000034f0| 0d 09 09 09 7d 0d 23 65 | 6e 64 69 66 0d 09 09 09 |....}.#e|ndif....|
|00003500| 62 72 65 61 6b 3b 0d 09 | 09 63 61 73 65 20 6b 4f |break;..|.case kO|
|00003510| 53 45 76 65 6e 74 3a 0d | 09 09 2f 2a 09 31 2e 30 |SEvent:.|../*.1.0|
|00003520| 32 20 2d 20 6d 75 73 74 | 20 42 69 74 41 4e 44 20 |2 - must| BitAND |
|00003530| 77 69 74 68 20 30 78 30 | 46 46 20 74 6f 20 67 65 |with 0x0|FF to ge|
|00003540| 74 20 6f 6e 6c 79 20 6c | 6f 77 20 62 79 74 65 20 |t only l|ow byte |
|00003550| 2a 2f 0d 09 09 09 73 77 | 69 74 63 68 20 28 28 65 |*/....sw|itch ((e|
|00003560| 76 65 6e 74 2d 3e 6d 65 | 73 73 61 67 65 20 3e 3e |vent->me|ssage >>|
|00003570| 20 32 34 29 20 26 20 30 | 78 30 46 46 29 20 7b 09 | 24) & 0|x0FF) {.|
|00003580| 09 2f 2a 20 68 69 67 68 | 20 62 79 74 65 20 6f 66 |./* high| byte of|
|00003590| 20 6d 65 73 73 61 67 65 | 20 2a 2f 0d 09 09 09 09 | message| */.....|
|000035a0| 63 61 73 65 20 6b 4d 6f | 75 73 65 4d 6f 76 65 64 |case kMo|useMoved|
|000035b0| 4d 65 73 73 61 67 65 3a | 0d 09 09 09 09 09 44 6f |Message:|......Do|
|000035c0| 49 64 6c 65 28 29 3b 09 | 09 09 09 09 2f 2a 20 6d |Idle();.|..../* m|
|000035d0| 6f 75 73 65 2d 6d 6f 76 | 65 64 20 69 73 20 61 6c |ouse-mov|ed is al|
|000035e0| 73 6f 20 61 6e 20 69 64 | 6c 65 20 65 76 65 6e 74 |so an id|le event|
|000035f0| 20 2a 2f 0d 09 09 09 09 | 09 62 72 65 61 6b 3b 0d | */.....|.break;.|
|00003600| 09 09 09 09 63 61 73 65 | 20 6b 53 75 73 70 65 6e |....case| kSuspen|
|00003610| 64 52 65 73 75 6d 65 4d | 65 73 73 61 67 65 3a 09 |dResumeM|essage:.|
|00003620| 09 2f 2a 20 73 75 73 70 | 65 6e 64 2f 72 65 73 75 |./* susp|end/resu|
|00003630| 6d 65 20 69 73 20 61 6c | 73 6f 20 61 6e 20 61 63 |me is al|so an ac|
|00003640| 74 69 76 61 74 65 2f 64 | 65 61 63 74 69 76 61 74 |tivate/d|eactivat|
|00003650| 65 20 2a 2f 0d 09 09 09 | 09 09 67 49 6e 42 61 63 |e */....|..gInBac|
|00003660| 6b 67 72 6f 75 6e 64 20 | 3d 20 28 65 76 65 6e 74 |kground |= (event|
|00003670| 2d 3e 6d 65 73 73 61 67 | 65 20 26 20 6b 52 65 73 |->messag|e & kRes|
|00003680| 75 6d 65 4d 61 73 6b 29 | 20 3d 3d 20 30 3b 0d 09 |umeMask)| == 0;..|
|00003690| 09 09 09 09 44 6f 41 63 | 74 69 76 61 74 65 28 46 |....DoAc|tivate(F|
|000036a0| 72 6f 6e 74 57 69 6e 64 | 6f 77 28 29 2c 20 21 67 |rontWind|ow(), !g|
|000036b0| 49 6e 42 61 63 6b 67 72 | 6f 75 6e 64 29 3b 0d 09 |InBackgr|ound);..|
|000036c0| 09 09 09 09 62 72 65 61 | 6b 3b 0d 09 09 09 7d 0d |....brea|k;....}.|
|000036d0| 09 09 09 62 72 65 61 6b | 3b 0d 09 7d 0d 7d 20 2f |...break|;..}.} /|
|000036e0| 2a 44 6f 45 76 65 6e 74 | 2a 2f 0d 0d 0d 2f 2a 09 |*DoEvent|*/.../*.|
|000036f0| 43 68 61 6e 67 65 20 74 | 68 65 20 63 75 72 73 6f |Change t|he curso|
|00003700| 72 27 73 20 73 68 61 70 | 65 2c 20 64 65 70 65 6e |r's shap|e, depen|
|00003710| 64 69 6e 67 20 6f 6e 20 | 69 74 73 20 70 6f 73 69 |ding on |its posi|
|00003720| 74 69 6f 6e 2e 20 54 68 | 69 73 20 61 6c 73 6f 20 |tion. Th|is also |
|00003730| 63 61 6c 63 75 6c 61 74 | 65 73 20 74 68 65 20 72 |calculat|es the r|
|00003740| 65 67 69 6f 6e 0d 09 77 | 68 65 72 65 20 74 68 65 |egion..w|here the|
|00003750| 20 63 75 72 72 65 6e 74 | 20 63 75 72 73 6f 72 20 | current| cursor |
|00003760| 72 65 73 69 64 65 73 20 | 28 66 6f 72 20 57 61 69 |resides |(for Wai|
|00003770| 74 4e 65 78 74 45 76 65 | 6e 74 29 2e 20 57 68 65 |tNextEve|nt). Whe|
|00003780| 6e 20 74 68 65 20 6d 6f | 75 73 65 20 6d 6f 76 65 |n the mo|use move|
|00003790| 73 20 6f 75 74 73 69 64 | 65 20 6f 66 0d 09 74 68 |s outsid|e of..th|
|000037a0| 69 73 20 72 65 67 69 6f | 6e 2c 20 61 6e 20 65 76 |is regio|n, an ev|
|000037b0| 65 6e 74 20 69 73 20 67 | 65 6e 65 72 61 74 65 64 |ent is g|enerated|
|000037c0| 2e 20 49 66 20 74 68 65 | 72 65 20 69 73 20 6d 6f |. If the|re is mo|
|000037d0| 72 65 20 74 6f 20 74 68 | 65 20 65 76 65 6e 74 20 |re to th|e event |
|000037e0| 74 68 61 6e 20 6a 75 73 | 74 0d 09 d2 74 68 65 20 |than jus|t...the |
|000037f0| 6d 6f 75 73 65 20 6d 6f | 76 65 64 d3 2c 20 77 65 |mouse mo|ved., we|
|00003800| 20 67 65 74 20 63 61 6c | 6c 65 64 20 62 65 66 6f | get cal|led befo|
|00003810| 72 65 20 74 68 65 20 65 | 76 65 6e 74 20 69 73 20 |re the e|vent is |
|00003820| 70 72 6f 63 65 73 73 65 | 64 20 74 6f 20 6d 61 6b |processe|d to mak|
|00003830| 65 20 73 75 72 65 0d 09 | 74 68 65 20 63 75 72 73 |e sure..|the curs|
|00003840| 6f 72 20 69 73 20 74 68 | 65 20 72 69 67 68 74 20 |or is th|e right |
|00003850| 6f 6e 65 2e 20 49 6e 20 | 61 6e 79 20 28 61 68 65 |one. In |any (ahe|
|00003860| 6d 29 20 65 76 65 6e 74 | 2c 20 74 68 69 73 20 69 |m) event|, this i|
|00003870| 73 20 63 61 6c 6c 65 64 | 20 61 67 61 69 6e 20 62 |s called| again b|
|00003880| 65 66 6f 72 65 20 77 65 | 0d 09 66 61 6c 6c 20 62 |efore we|..fall b|
|00003890| 61 63 6b 20 69 6e 74 6f | 20 57 4e 45 2e 20 2a 2f |ack into| WNE. */|
|000038a0| 0d 0d 23 70 72 61 67 6d | 61 20 73 65 67 6d 65 6e |..#pragm|a segmen|
|000038b0| 74 20 4d 61 69 6e 0d 76 | 6f 69 64 20 41 64 6a 75 |t Main.v|oid Adju|
|000038c0| 73 74 43 75 72 73 6f 72 | 28 6d 6f 75 73 65 2c 72 |stCursor|(mouse,r|
|000038d0| 65 67 69 6f 6e 29 0d 09 | 50 6f 69 6e 74 09 09 6d |egion)..|Point..m|
|000038e0| 6f 75 73 65 3b 0d 09 52 | 67 6e 48 61 6e 64 6c 65 |ouse;..R|gnHandle|
|000038f0| 09 72 65 67 69 6f 6e 3b | 0d 7b 0d 09 57 69 6e 64 |.region;|.{..Wind|
|00003900| 6f 77 50 74 72 09 77 69 | 6e 64 6f 77 3b 0d 09 52 |owPtr.wi|ndow;..R|
|00003910| 67 6e 48 61 6e 64 6c 65 | 09 61 72 72 6f 77 52 67 |gnHandle|.arrowRg|
|00003920| 6e 3b 0d 09 52 67 6e 48 | 61 6e 64 6c 65 09 69 42 |n;..RgnH|andle.iB|
|00003930| 65 61 6d 52 67 6e 3b 0d | 09 52 65 63 74 09 09 69 |eamRgn;.|.Rect..i|
|00003940| 42 65 61 6d 52 65 63 74 | 3b 0d 0d 09 77 69 6e 64 |BeamRect|;...wind|
|00003950| 6f 77 20 3d 20 46 72 6f | 6e 74 57 69 6e 64 6f 77 |ow = Fro|ntWindow|
|00003960| 28 29 3b 09 2f 2a 20 77 | 65 20 6f 6e 6c 79 20 61 |();./* w|e only a|
|00003970| 64 6a 75 73 74 20 74 68 | 65 20 63 75 72 73 6f 72 |djust th|e cursor|
|00003980| 20 77 68 65 6e 20 77 65 | 20 61 72 65 20 69 6e 20 | when we| are in |
|00003990| 66 72 6f 6e 74 20 2a 2f | 0d 09 69 66 20 28 20 28 |front */|..if ( (|
|000039a0| 21 20 67 49 6e 42 61 63 | 6b 67 72 6f 75 6e 64 29 |! gInBac|kground)|
|000039b0| 20 26 26 20 28 21 20 49 | 73 44 41 57 69 6e 64 6f | && (! I|sDAWindo|
|000039c0| 77 28 77 69 6e 64 6f 77 | 29 29 20 29 20 7b 0d 09 |w(window|)) ) {..|
|000039d0| 09 2f 2a 20 63 61 6c 63 | 75 6c 61 74 65 20 72 65 |./* calc|ulate re|
|000039e0| 67 69 6f 6e 73 20 66 6f | 72 20 64 69 66 66 65 72 |gions fo|r differ|
|000039f0| 65 6e 74 20 63 75 72 73 | 6f 72 20 73 68 61 70 65 |ent curs|or shape|
|00003a00| 73 20 2a 2f 0d 09 09 61 | 72 72 6f 77 52 67 6e 20 |s */...a|rrowRgn |
|00003a10| 3d 20 4e 65 77 52 67 6e | 28 29 3b 0d 09 09 69 42 |= NewRgn|();...iB|
|00003a20| 65 61 6d 52 67 6e 20 3d | 20 4e 65 77 52 67 6e 28 |eamRgn =| NewRgn(|
|00003a30| 29 3b 0d 0d 09 09 2f 2a | 20 73 74 61 72 74 20 61 |);..../*| start a|
|00003a40| 72 72 6f 77 52 67 6e 20 | 77 69 64 65 20 6f 70 65 |rrowRgn |wide ope|
|00003a50| 6e 20 2a 2f 0d 09 09 53 | 65 74 52 65 63 74 52 67 |n */...S|etRectRg|
|00003a60| 6e 28 61 72 72 6f 77 52 | 67 6e 2c 20 6b 45 78 74 |n(arrowR|gn, kExt|
|00003a70| 72 65 6d 65 4e 65 67 2c | 20 6b 45 78 74 72 65 6d |remeNeg,| kExtrem|
|00003a80| 65 4e 65 67 2c 20 6b 45 | 78 74 72 65 6d 65 50 6f |eNeg, kE|xtremePo|
|00003a90| 73 2c 20 6b 45 78 74 72 | 65 6d 65 50 6f 73 29 3b |s, kExtr|emePos);|
|00003aa0| 0d 0d 09 09 2f 2a 20 63 | 61 6c 63 75 6c 61 74 65 |..../* c|alculate|
|00003ab0| 20 69 42 65 61 6d 52 67 | 6e 20 2a 2f 0d 09 09 69 | iBeamRg|n */...i|
|00003ac0| 66 20 28 20 49 73 41 70 | 70 57 69 6e 64 6f 77 28 |f ( IsAp|pWindow(|
|00003ad0| 77 69 6e 64 6f 77 29 20 | 29 20 7b 0d 09 09 09 69 |window) |) {....i|
|00003ae0| 42 65 61 6d 52 65 63 74 | 20 3d 20 28 2a 28 28 44 |BeamRect| = (*((D|
|00003af0| 6f 63 75 6d 65 6e 74 50 | 65 65 6b 29 20 77 69 6e |ocumentP|eek) win|
|00003b00| 64 6f 77 29 2d 3e 64 6f | 63 54 45 29 2d 3e 76 69 |dow)->do|cTE)->vi|
|00003b10| 65 77 52 65 63 74 3b 0d | 09 09 09 53 65 74 50 6f |ewRect;.|...SetPo|
|00003b20| 72 74 28 77 69 6e 64 6f | 77 29 3b 09 2f 2a 20 6d |rt(windo|w);./* m|
|00003b30| 61 6b 65 20 61 20 67 6c | 6f 62 61 6c 20 76 65 72 |ake a gl|obal ver|
|00003b40| 73 69 6f 6e 20 6f 66 20 | 74 68 65 20 76 69 65 77 |sion of |the view|
|00003b50| 52 65 63 74 20 2a 2f 0d | 09 09 09 4c 6f 63 61 6c |Rect */.|...Local|
|00003b60| 54 6f 47 6c 6f 62 61 6c | 28 26 54 6f 70 4c 65 66 |ToGlobal|(&TopLef|
|00003b70| 74 28 69 42 65 61 6d 52 | 65 63 74 29 29 3b 0d 09 |t(iBeamR|ect));..|
|00003b80| 09 09 4c 6f 63 61 6c 54 | 6f 47 6c 6f 62 61 6c 28 |..LocalT|oGlobal(|
|00003b90| 26 42 6f 74 52 69 67 68 | 74 28 69 42 65 61 6d 52 |&BotRigh|t(iBeamR|
|00003ba0| 65 63 74 29 29 3b 0d 09 | 09 09 52 65 63 74 52 67 |ect));..|..RectRg|
|00003bb0| 6e 28 69 42 65 61 6d 52 | 67 6e 2c 20 26 69 42 65 |n(iBeamR|gn, &iBe|
|00003bc0| 61 6d 52 65 63 74 29 3b | 0d 09 09 09 2f 2a 20 77 |amRect);|..../* w|
|00003bd0| 65 20 74 65 6d 70 6f 72 | 61 72 69 6c 79 20 63 68 |e tempor|arily ch|
|00003be0| 61 6e 67 65 20 74 68 65 | 20 70 6f 72 74 d5 73 20 |ange the| port.s |
|00003bf0| 6f 72 69 67 69 6e 20 74 | 6f 20 d2 67 6c 6f 62 61 |origin t|o .globa|
|00003c00| 6c 66 79 d3 20 74 68 65 | 20 76 69 73 52 67 6e 20 |lfy. the| visRgn |
|00003c10| 2a 2f 0d 09 09 09 53 65 | 74 4f 72 69 67 69 6e 28 |*/....Se|tOrigin(|
|00003c20| 2d 77 69 6e 64 6f 77 2d | 3e 70 6f 72 74 42 69 74 |-window-|>portBit|
|00003c30| 73 2e 62 6f 75 6e 64 73 | 2e 6c 65 66 74 2c 20 2d |s.bounds|.left, -|
|00003c40| 77 69 6e 64 6f 77 2d 3e | 70 6f 72 74 42 69 74 73 |window->|portBits|
|00003c50| 2e 62 6f 75 6e 64 73 2e | 74 6f 70 29 3b 0d 09 09 |.bounds.|top);...|
|00003c60| 09 53 65 63 74 52 67 6e | 28 69 42 65 61 6d 52 67 |.SectRgn|(iBeamRg|
|00003c70| 6e 2c 20 77 69 6e 64 6f | 77 2d 3e 76 69 73 52 67 |n, windo|w->visRg|
|00003c80| 6e 2c 20 69 42 65 61 6d | 52 67 6e 29 3b 0d 09 09 |n, iBeam|Rgn);...|
|00003c90| 09 53 65 74 4f 72 69 67 | 69 6e 28 30 2c 20 30 29 |.SetOrig|in(0, 0)|
|00003ca0| 3b 0d 09 09 7d 0d 0d 09 | 09 2f 2a 20 73 75 62 74 |;...}...|./* subt|
|00003cb0| 72 61 63 74 20 6f 74 68 | 65 72 20 72 65 67 69 6f |ract oth|er regio|
|00003cc0| 6e 73 20 66 72 6f 6d 20 | 61 72 72 6f 77 52 67 6e |ns from |arrowRgn|
|00003cd0| 20 2a 2f 0d 09 09 44 69 | 66 66 52 67 6e 28 61 72 | */...Di|ffRgn(ar|
|00003ce0| 72 6f 77 52 67 6e 2c 20 | 69 42 65 61 6d 52 67 6e |rowRgn, |iBeamRgn|
|00003cf0| 2c 20 61 72 72 6f 77 52 | 67 6e 29 3b 0d 0d 09 09 |, arrowR|gn);....|
|00003d00| 2f 2a 20 63 68 61 6e 67 | 65 20 74 68 65 20 63 75 |/* chang|e the cu|
|00003d10| 72 73 6f 72 20 61 6e 64 | 20 74 68 65 20 72 65 67 |rsor and| the reg|
|00003d20| 69 6f 6e 20 70 61 72 61 | 6d 65 74 65 72 20 2a 2f |ion para|meter */|
|00003d30| 0d 09 09 69 66 20 28 20 | 50 74 49 6e 52 67 6e 28 |...if ( |PtInRgn(|
|00003d40| 6d 6f 75 73 65 2c 20 69 | 42 65 61 6d 52 67 6e 29 |mouse, i|BeamRgn)|
|00003d50| 20 29 20 7b 0d 09 09 09 | 53 65 74 43 75 72 73 6f | ) {....|SetCurso|
|00003d60| 72 28 2a 47 65 74 43 75 | 72 73 6f 72 28 69 42 65 |r(*GetCu|rsor(iBe|
|00003d70| 61 6d 43 75 72 73 6f 72 | 29 29 3b 0d 09 09 09 43 |amCursor|));....C|
|00003d80| 6f 70 79 52 67 6e 28 69 | 42 65 61 6d 52 67 6e 2c |opyRgn(i|BeamRgn,|
|00003d90| 20 72 65 67 69 6f 6e 29 | 3b 0d 09 09 7d 20 65 6c | region)|;...} el|
|00003da0| 73 65 20 7b 0d 09 09 09 | 53 65 74 43 75 72 73 6f |se {....|SetCurso|
|00003db0| 72 28 26 71 64 2e 61 72 | 72 6f 77 29 3b 0d 09 09 |r(&qd.ar|row);...|
|00003dc0| 09 43 6f 70 79 52 67 6e | 28 61 72 72 6f 77 52 67 |.CopyRgn|(arrowRg|
|00003dd0| 6e 2c 20 72 65 67 69 6f | 6e 29 3b 0d 09 09 7d 0d |n, regio|n);...}.|
|00003de0| 0d 09 09 44 69 73 70 6f | 73 65 52 67 6e 28 61 72 |...Dispo|seRgn(ar|
|00003df0| 72 6f 77 52 67 6e 29 3b | 0d 09 09 44 69 73 70 6f |rowRgn);|...Dispo|
|00003e00| 73 65 52 67 6e 28 69 42 | 65 61 6d 52 67 6e 29 3b |seRgn(iB|eamRgn);|
|00003e10| 0d 09 7d 0d 7d 20 2f 2a | 41 64 6a 75 73 74 43 75 |..}.} /*|AdjustCu|
|00003e20| 72 73 6f 72 2a 2f 0d 0d | 0d 2f 2a 09 47 65 74 20 |rsor*/..|./*.Get |
|00003e30| 74 68 65 20 67 6c 6f 62 | 61 6c 20 63 6f 6f 72 64 |the glob|al coord|
|00003e40| 69 6e 61 74 65 73 20 6f | 66 20 74 68 65 20 6d 6f |inates o|f the mo|
|00003e50| 75 73 65 2e 20 57 68 65 | 6e 20 79 6f 75 20 63 61 |use. Whe|n you ca|
|00003e60| 6c 6c 20 4f 53 45 76 65 | 6e 74 41 76 61 69 6c 0d |ll OSEve|ntAvail.|
|00003e70| 09 69 74 20 77 69 6c 6c | 20 72 65 74 75 72 6e 20 |.it will| return |
|00003e80| 65 69 74 68 65 72 20 61 | 20 70 65 6e 64 69 6e 67 |either a| pending|
|00003e90| 20 65 76 65 6e 74 20 6f | 72 20 61 20 6e 75 6c 6c | event o|r a null|
|00003ea0| 20 65 76 65 6e 74 2e 20 | 49 6e 20 65 69 74 68 65 | event. |In eithe|
|00003eb0| 72 20 63 61 73 65 2c 0d | 09 74 68 65 20 77 68 65 |r case,.|.the whe|
|00003ec0| 72 65 20 66 69 65 6c 64 | 20 6f 66 20 74 68 65 20 |re field| of the |
|00003ed0| 65 76 65 6e 74 20 72 65 | 63 6f 72 64 20 77 69 6c |event re|cord wil|
|00003ee0| 6c 20 63 6f 6e 74 61 69 | 6e 20 74 68 65 20 63 75 |l contai|n the cu|
|00003ef0| 72 72 65 6e 74 20 70 6f | 73 69 74 69 6f 6e 0d 09 |rrent po|sition..|
|00003f00| 6f 66 20 74 68 65 20 6d | 6f 75 73 65 20 69 6e 20 |of the m|ouse in |
|00003f10| 67 6c 6f 62 61 6c 20 63 | 6f 6f 72 64 69 6e 61 74 |global c|oordinat|
|00003f20| 65 73 20 61 6e 64 20 74 | 68 65 20 6d 6f 64 69 66 |es and t|he modif|
|00003f30| 69 65 72 73 20 66 69 65 | 6c 64 20 77 69 6c 6c 20 |iers fie|ld will |
|00003f40| 72 65 66 6c 65 63 74 0d | 09 74 68 65 20 63 75 72 |reflect.|.the cur|
|00003f50| 72 65 6e 74 20 73 74 61 | 74 65 20 6f 66 20 74 68 |rent sta|te of th|
|00003f60| 65 20 6d 6f 64 69 66 69 | 65 72 73 2e 20 41 6e 6f |e modifi|ers. Ano|
|00003f70| 74 68 65 72 20 77 61 79 | 20 74 6f 20 67 65 74 20 |ther way| to get |
|00003f80| 74 68 65 20 67 6c 6f 62 | 61 6c 0d 09 63 6f 6f 72 |the glob|al..coor|
|00003f90| 64 69 6e 61 74 65 73 20 | 69 73 20 74 6f 20 63 61 |dinates |is to ca|
|00003fa0| 6c 6c 20 47 65 74 4d 6f | 75 73 65 20 61 6e 64 20 |ll GetMo|use and |
|00003fb0| 4c 6f 63 61 6c 54 6f 47 | 6c 6f 62 61 6c 2c 20 62 |LocalToG|lobal, b|
|00003fc0| 75 74 20 74 68 61 74 20 | 72 65 71 75 69 72 65 73 |ut that |requires|
|00003fd0| 0d 09 62 65 69 6e 67 20 | 73 75 72 65 20 74 68 61 |..being |sure tha|
|00003fe0| 74 20 74 68 65 50 6f 72 | 74 20 69 73 20 73 65 74 |t thePor|t is set|
|00003ff0| 20 74 6f 20 61 20 76 61 | 6c 69 64 20 70 6f 72 74 | to a va|lid port|
|00004000| 2e 20 2a 2f 0d 0d 23 70 | 72 61 67 6d 61 20 73 65 |. */..#p|ragma se|
|00004010| 67 6d 65 6e 74 20 4d 61 | 69 6e 0d 76 6f 69 64 20 |gment Ma|in.void |
|00004020| 47 65 74 47 6c 6f 62 61 | 6c 4d 6f 75 73 65 28 6d |GetGloba|lMouse(m|
|00004030| 6f 75 73 65 29 0d 09 50 | 6f 69 6e 74 09 2a 6d 6f |ouse)..P|oint.*mo|
|00004040| 75 73 65 3b 0d 7b 0d 09 | 45 76 65 6e 74 52 65 63 |use;.{..|EventRec|
|00004050| 6f 72 64 09 65 76 65 6e | 74 3b 0d 09 0d 09 4f 53 |ord.even|t;....OS|
|00004060| 45 76 65 6e 74 41 76 61 | 69 6c 28 6b 4e 6f 45 76 |EventAva|il(kNoEv|
|00004070| 65 6e 74 73 2c 20 26 65 | 76 65 6e 74 29 3b 09 2f |ents, &e|vent);./|
|00004080| 2a 20 77 65 20 61 72 65 | 6e 27 74 20 69 6e 74 65 |* we are|n't inte|
|00004090| 72 65 73 74 65 64 20 69 | 6e 20 61 6e 79 20 65 76 |rested i|n any ev|
|000040a0| 65 6e 74 73 20 2a 2f 0d | 09 2a 6d 6f 75 73 65 20 |ents */.|.*mouse |
|000040b0| 3d 20 65 76 65 6e 74 2e | 77 68 65 72 65 3b 09 09 |= event.|where;..|
|000040c0| 09 09 2f 2a 20 6a 75 73 | 74 20 74 68 65 20 6d 6f |../* jus|t the mo|
|000040d0| 75 73 65 20 70 6f 73 69 | 74 69 6f 6e 20 2a 2f 0d |use posi|tion */.|
|000040e0| 7d 20 2f 2a 47 65 74 47 | 6c 6f 62 61 6c 4d 6f 75 |} /*GetG|lobalMou|
|000040f0| 73 65 2a 2f 0d 0d 0d 2f | 2a 09 43 61 6c 6c 65 64 |se*/.../|*.Called|
|00004100| 20 77 68 65 6e 20 61 20 | 6d 6f 75 73 65 44 6f 77 | when a |mouseDow|
|00004110| 6e 20 6f 63 63 75 72 73 | 20 69 6e 20 74 68 65 20 |n occurs| in the |
|00004120| 67 72 6f 77 20 62 6f 78 | 20 6f 66 20 61 6e 20 61 |grow box| of an a|
|00004130| 63 74 69 76 65 20 77 69 | 6e 64 6f 77 2e 20 49 6e |ctive wi|ndow. In|
|00004140| 0d 09 6f 72 64 65 72 20 | 74 6f 20 65 6c 69 6d 69 |..order |to elimi|
|00004150| 6e 61 74 65 20 61 6e 79 | 20 27 66 6c 69 63 6b 65 |nate any| 'flicke|
|00004160| 72 27 2c 20 77 65 20 77 | 61 6e 74 20 74 6f 20 69 |r', we w|ant to i|
|00004170| 6e 76 61 6c 69 64 61 74 | 65 20 6f 6e 6c 79 20 77 |nvalidat|e only w|
|00004180| 68 61 74 20 69 73 0d 09 | 6e 65 63 65 73 73 61 72 |hat is..|necessar|
|00004190| 79 2e 20 53 69 6e 63 65 | 20 52 65 73 69 7a 65 57 |y. Since| ResizeW|
|000041a0| 69 6e 64 6f 77 20 69 6e | 76 61 6c 69 64 61 74 65 |indow in|validate|
|000041b0| 73 20 74 68 65 20 77 68 | 6f 6c 65 20 70 6f 72 74 |s the wh|ole port|
|000041c0| 52 65 63 74 2c 20 77 65 | 20 73 61 76 65 0d 09 74 |Rect, we| save..t|
|000041d0| 68 65 20 6f 6c 64 20 54 | 45 20 76 69 65 77 52 65 |he old T|E viewRe|
|000041e0| 63 74 2c 20 69 6e 74 65 | 72 73 65 63 74 20 69 74 |ct, inte|rsect it|
|000041f0| 20 77 69 74 68 20 74 68 | 65 20 6e 65 77 20 54 45 | with th|e new TE|
|00004200| 20 76 69 65 77 52 65 63 | 74 2c 20 61 6e 64 0d 09 | viewRec|t, and..|
|00004210| 72 65 6d 6f 76 65 20 74 | 68 65 20 72 65 73 75 6c |remove t|he resul|
|00004220| 74 20 66 72 6f 6d 20 74 | 68 65 20 75 70 64 61 74 |t from t|he updat|
|00004230| 65 20 72 65 67 69 6f 6e | 2e 20 48 6f 77 65 76 65 |e region|. Howeve|
|00004240| 72 2c 20 77 65 20 6d 75 | 73 74 20 6d 61 6b 65 20 |r, we mu|st make |
|00004250| 73 75 72 65 0d 09 74 68 | 61 74 20 61 6e 79 20 6f |sure..th|at any o|
|00004260| 6c 64 20 75 70 64 61 74 | 65 20 72 65 67 69 6f 6e |ld updat|e region|
|00004270| 20 74 68 61 74 20 6d 69 | 67 68 74 20 68 61 76 65 | that mi|ght have|
|00004280| 20 62 65 65 6e 20 61 72 | 6f 75 6e 64 20 67 65 74 | been ar|ound get|
|00004290| 73 20 70 75 74 20 62 61 | 63 6b 2e 20 2a 2f 0d 0d |s put ba|ck. */..|
|000042a0| 23 70 72 61 67 6d 61 20 | 73 65 67 6d 65 6e 74 20 |#pragma |segment |
|000042b0| 4d 61 69 6e 0d 76 6f 69 | 64 20 44 6f 47 72 6f 77 |Main.voi|d DoGrow|
|000042c0| 57 69 6e 64 6f 77 28 77 | 69 6e 64 6f 77 2c 65 76 |Window(w|indow,ev|
|000042d0| 65 6e 74 29 0d 09 57 69 | 6e 64 6f 77 50 74 72 09 |ent)..Wi|ndowPtr.|
|000042e0| 77 69 6e 64 6f 77 3b 0d | 09 45 76 65 6e 74 52 65 |window;.|.EventRe|
|000042f0| 63 6f 72 64 09 2a 65 76 | 65 6e 74 3b 0d 7b 0d 09 |cord.*ev|ent;.{..|
|00004300| 6c 6f 6e 67 09 09 67 72 | 6f 77 52 65 73 75 6c 74 |long..gr|owResult|
|00004310| 3b 0d 09 52 65 63 74 09 | 09 74 65 6d 70 52 65 63 |;..Rect.|.tempRec|
|00004320| 74 3b 0d 09 52 67 6e 48 | 61 6e 64 6c 65 09 74 65 |t;..RgnH|andle.te|
|00004330| 6d 70 52 67 6e 3b 0d 09 | 44 6f 63 75 6d 65 6e 74 |mpRgn;..|Document|
|00004340| 50 65 65 6b 20 64 6f 63 | 3b 0d 09 0d 09 74 65 6d |Peek doc|;....tem|
|00004350| 70 52 65 63 74 20 3d 20 | 71 64 2e 73 63 72 65 65 |pRect = |qd.scree|
|00004360| 6e 42 69 74 73 2e 62 6f | 75 6e 64 73 3b 09 09 09 |nBits.bo|unds;...|
|00004370| 09 09 2f 2a 20 73 65 74 | 20 75 70 20 6c 69 6d 69 |../* set| up limi|
|00004380| 74 69 6e 67 20 76 61 6c | 75 65 73 20 2a 2f 0d 09 |ting val|ues */..|
|00004390| 74 65 6d 70 52 65 63 74 | 2e 6c 65 66 74 20 3d 20 |tempRect|.left = |
|000043a0| 6b 4d 69 6e 44 6f 63 44 | 69 6d 3b 0d 09 74 65 6d |kMinDocD|im;..tem|
|000043b0| 70 52 65 63 74 2e 74 6f | 70 20 3d 20 6b 4d 69 6e |pRect.to|p = kMin|
|000043c0| 44 6f 63 44 69 6d 3b 0d | 09 67 72 6f 77 52 65 73 |DocDim;.|.growRes|
|000043d0| 75 6c 74 20 3d 20 47 72 | 6f 77 57 69 6e 64 6f 77 |ult = Gr|owWindow|
|000043e0| 28 77 69 6e 64 6f 77 2c | 20 65 76 65 6e 74 2d 3e |(window,| event->|
|000043f0| 77 68 65 72 65 2c 20 26 | 74 65 6d 70 52 65 63 74 |where, &|tempRect|
|00004400| 29 3b 0d 09 2f 2a 20 73 | 65 65 20 69 66 20 69 74 |);../* s|ee if it|
|00004410| 20 72 65 61 6c 6c 79 20 | 63 68 61 6e 67 65 64 20 | really |changed |
|00004420| 73 69 7a 65 20 2a 2f 0d | 09 69 66 20 28 20 67 72 |size */.|.if ( gr|
|00004430| 6f 77 52 65 73 75 6c 74 | 20 21 3d 20 30 20 29 20 |owResult| != 0 ) |
|00004440| 7b 0d 09 09 64 6f 63 20 | 3d 20 28 44 6f 63 75 6d |{...doc |= (Docum|
|00004450| 65 6e 74 50 65 65 6b 29 | 20 77 69 6e 64 6f 77 3b |entPeek)| window;|
|00004460| 0d 09 09 74 65 6d 70 52 | 65 63 74 20 3d 20 28 2a |...tempR|ect = (*|
|00004470| 64 6f 63 2d 3e 64 6f 63 | 54 45 29 2d 3e 76 69 65 |doc->doc|TE)->vie|
|00004480| 77 52 65 63 74 3b 09 09 | 09 09 2f 2a 20 73 61 76 |wRect;..|../* sav|
|00004490| 65 20 6f 6c 64 20 74 65 | 78 74 20 62 6f 78 20 2a |e old te|xt box *|
|000044a0| 2f 0d 09 09 74 65 6d 70 | 52 67 6e 20 3d 20 4e 65 |/...temp|Rgn = Ne|
|000044b0| 77 52 67 6e 28 29 3b 0d | 09 09 47 65 74 4c 6f 63 |wRgn();.|..GetLoc|
|000044c0| 61 6c 55 70 64 61 74 65 | 52 67 6e 28 77 69 6e 64 |alUpdate|Rgn(wind|
|000044d0| 6f 77 2c 20 74 65 6d 70 | 52 67 6e 29 3b 09 09 09 |ow, temp|Rgn);...|
|000044e0| 09 2f 2a 20 67 65 74 20 | 6c 6f 63 61 6c 69 7a 65 |./* get |localize|
|000044f0| 64 20 75 70 64 61 74 65 | 20 72 65 67 69 6f 6e 20 |d update| region |
|00004500| 2a 2f 0d 09 09 53 69 7a | 65 57 69 6e 64 6f 77 28 |*/...Siz|eWindow(|
|00004510| 77 69 6e 64 6f 77 2c 20 | 4c 6f 57 72 64 28 67 72 |window, |LoWrd(gr|
|00004520| 6f 77 52 65 73 75 6c 74 | 29 2c 20 48 69 57 72 64 |owResult|), HiWrd|
|00004530| 28 67 72 6f 77 52 65 73 | 75 6c 74 29 2c 20 74 72 |(growRes|ult), tr|
|00004540| 75 65 29 3b 0d 09 09 52 | 65 73 69 7a 65 57 69 6e |ue);...R|esizeWin|
|00004550| 64 6f 77 28 77 69 6e 64 | 6f 77 29 3b 0d 09 09 2f |dow(wind|ow);.../|
|00004560| 2a 20 63 61 6c 63 75 6c | 61 74 65 20 26 20 76 61 |* calcul|ate & va|
|00004570| 6c 69 64 61 74 65 20 74 | 68 65 20 72 65 67 69 6f |lidate t|he regio|
|00004580| 6e 20 74 68 61 74 20 68 | 61 73 6e d5 74 20 63 68 |n that h|asn.t ch|
|00004590| 61 6e 67 65 64 20 73 6f | 20 69 74 20 77 6f 6e d5 |anged so| it won.|
|000045a0| 74 20 67 65 74 20 72 65 | 64 72 61 77 6e 20 2a 2f |t get re|drawn */|
|000045b0| 0d 09 09 53 65 63 74 52 | 65 63 74 28 26 74 65 6d |...SectR|ect(&tem|
|000045c0| 70 52 65 63 74 2c 20 26 | 28 2a 64 6f 63 2d 3e 64 |pRect, &|(*doc->d|
|000045d0| 6f 63 54 45 29 2d 3e 76 | 69 65 77 52 65 63 74 2c |ocTE)->v|iewRect,|
|000045e0| 20 26 74 65 6d 70 52 65 | 63 74 29 3b 0d 09 09 56 | &tempRe|ct);...V|
|000045f0| 61 6c 69 64 52 65 63 74 | 28 26 74 65 6d 70 52 65 |alidRect|(&tempRe|
|00004600| 63 74 29 3b 09 09 09 09 | 09 09 09 2f 2a 20 74 61 |ct);....|.../* ta|
|00004610| 6b 65 20 69 74 20 6f 75 | 74 20 6f 66 20 75 70 64 |ke it ou|t of upd|
|00004620| 61 74 65 20 2a 2f 0d 09 | 09 49 6e 76 61 6c 52 67 |ate */..|.InvalRg|
|00004630| 6e 28 74 65 6d 70 52 67 | 6e 29 3b 09 09 09 09 09 |n(tempRg|n);.....|
|00004640| 09 09 09 2f 2a 20 70 75 | 74 20 62 61 63 6b 20 61 |.../* pu|t back a|
|00004650| 6e 79 20 70 72 69 6f 72 | 20 75 70 64 61 74 65 20 |ny prior| update |
|00004660| 2a 2f 0d 09 09 44 69 73 | 70 6f 73 65 52 67 6e 28 |*/...Dis|poseRgn(|
|00004670| 74 65 6d 70 52 67 6e 29 | 3b 0d 09 7d 0d 7d 20 2f |tempRgn)|;..}.} /|
|00004680| 2a 20 44 6f 47 72 6f 77 | 57 69 6e 64 6f 77 20 2a |* DoGrow|Window *|
|00004690| 2f 0d 0d 0d 2f 2a 20 09 | 43 61 6c 6c 65 64 20 77 |/.../* .|Called w|
|000046a0| 68 65 6e 20 61 20 6d 6f | 75 73 65 43 6c 69 63 6b |hen a mo|useClick|
|000046b0| 20 6f 63 63 75 72 73 20 | 69 6e 20 74 68 65 20 7a | occurs |in the z|
|000046c0| 6f 6f 6d 20 62 6f 78 20 | 6f 66 20 61 6e 20 61 63 |oom box |of an ac|
|000046d0| 74 69 76 65 20 77 69 6e | 64 6f 77 2e 0d 09 45 76 |tive win|dow...Ev|
|000046e0| 65 72 79 74 68 69 6e 67 | 20 68 61 73 20 74 6f 20 |erything| has to |
|000046f0| 67 65 74 20 72 65 2d 64 | 72 61 77 6e 20 68 65 72 |get re-d|rawn her|
|00004700| 65 2c 20 73 6f 20 77 65 | 20 64 6f 6e 27 74 20 6d |e, so we| don't m|
|00004710| 69 6e 64 20 74 68 61 74 | 0d 09 52 65 73 69 7a 65 |ind that|..Resize|
|00004720| 57 69 6e 64 6f 77 20 69 | 6e 76 61 6c 69 64 61 74 |Window i|nvalidat|
|00004730| 65 73 20 74 68 65 20 77 | 68 6f 6c 65 20 70 6f 72 |es the w|hole por|
|00004740| 74 52 65 63 74 2e 20 2a | 2f 0d 0d 23 70 72 61 67 |tRect. *|/..#prag|
|00004750| 6d 61 20 73 65 67 6d 65 | 6e 74 20 4d 61 69 6e 0d |ma segme|nt Main.|
|00004760| 76 6f 69 64 20 44 6f 5a | 6f 6f 6d 57 69 6e 64 6f |void DoZ|oomWindo|
|00004770| 77 28 77 69 6e 64 6f 77 | 2c 70 61 72 74 29 0d 09 |w(window|,part)..|
|00004780| 57 69 6e 64 6f 77 50 74 | 72 09 77 69 6e 64 6f 77 |WindowPt|r.window|
|00004790| 3b 0d 09 73 68 6f 72 74 | 09 09 70 61 72 74 3b 0d |;..short|..part;.|
|000047a0| 7b 0d 09 45 72 61 73 65 | 52 65 63 74 28 26 77 69 |{..Erase|Rect(&wi|
|000047b0| 6e 64 6f 77 2d 3e 70 6f | 72 74 52 65 63 74 29 3b |ndow->po|rtRect);|
|000047c0| 0d 09 5a 6f 6f 6d 57 69 | 6e 64 6f 77 28 77 69 6e |..ZoomWi|ndow(win|
|000047d0| 64 6f 77 2c 20 70 61 72 | 74 2c 20 77 69 6e 64 6f |dow, par|t, windo|
|000047e0| 77 20 3d 3d 20 46 72 6f | 6e 74 57 69 6e 64 6f 77 |w == Fro|ntWindow|
|000047f0| 28 29 29 3b 0d 09 52 65 | 73 69 7a 65 57 69 6e 64 |());..Re|sizeWind|
|00004800| 6f 77 28 77 69 6e 64 6f | 77 29 3b 0d 7d 20 2f 2a |ow(windo|w);.} /*|
|00004810| 20 20 44 6f 5a 6f 6f 6d | 57 69 6e 64 6f 77 20 2a | DoZoom|Window *|
|00004820| 2f 0d 0d 0d 2f 2a 20 43 | 61 6c 6c 65 64 20 77 68 |/.../* C|alled wh|
|00004830| 65 6e 20 74 68 65 20 77 | 69 6e 64 6f 77 20 68 61 |en the w|indow ha|
|00004840| 73 20 62 65 65 6e 20 72 | 65 73 69 7a 65 64 20 74 |s been r|esized t|
|00004850| 6f 20 66 69 78 20 75 70 | 20 74 68 65 20 63 6f 6e |o fix up| the con|
|00004860| 74 72 6f 6c 73 20 61 6e | 64 20 63 6f 6e 74 65 6e |trols an|d conten|
|00004870| 74 2e 20 2a 2f 0d 23 70 | 72 61 67 6d 61 20 73 65 |t. */.#p|ragma se|
|00004880| 67 6d 65 6e 74 20 4d 61 | 69 6e 0d 76 6f 69 64 20 |gment Ma|in.void |
|00004890| 52 65 73 69 7a 65 57 69 | 6e 64 6f 77 28 77 69 6e |ResizeWi|ndow(win|
|000048a0| 64 6f 77 29 0d 09 57 69 | 6e 64 6f 77 50 74 72 09 |dow)..Wi|ndowPtr.|
|000048b0| 77 69 6e 64 6f 77 3b 0d | 7b 0d 09 41 64 6a 75 73 |window;.|{..Adjus|
|000048c0| 74 53 63 72 6f 6c 6c 62 | 61 72 73 28 77 69 6e 64 |tScrollb|ars(wind|
|000048d0| 6f 77 2c 20 74 72 75 65 | 29 3b 0d 09 41 64 6a 75 |ow, true|);..Adju|
|000048e0| 73 74 54 45 28 77 69 6e | 64 6f 77 29 3b 0d 09 49 |stTE(win|dow);..I|
|000048f0| 6e 76 61 6c 52 65 63 74 | 28 26 77 69 6e 64 6f 77 |nvalRect|(&window|
|00004900| 2d 3e 70 6f 72 74 52 65 | 63 74 29 3b 0d 7d 20 2f |->portRe|ct);.} /|
|00004910| 2a 20 52 65 73 69 7a 65 | 57 69 6e 64 6f 77 20 2a |* Resize|Window *|
|00004920| 2f 0d 0d 0d 2f 2a 20 52 | 65 74 75 72 6e 73 20 74 |/.../* R|eturns t|
|00004930| 68 65 20 75 70 64 61 74 | 65 20 72 65 67 69 6f 6e |he updat|e region|
|00004940| 20 69 6e 20 6c 6f 63 61 | 6c 20 63 6f 6f 72 64 69 | in loca|l coordi|
|00004950| 6e 61 74 65 73 20 2a 2f | 0d 23 70 72 61 67 6d 61 |nates */|.#pragma|
|00004960| 20 73 65 67 6d 65 6e 74 | 20 4d 61 69 6e 0d 76 6f | segment| Main.vo|
|00004970| 69 64 20 47 65 74 4c 6f | 63 61 6c 55 70 64 61 74 |id GetLo|calUpdat|
|00004980| 65 52 67 6e 28 77 69 6e | 64 6f 77 2c 6c 6f 63 61 |eRgn(win|dow,loca|
|00004990| 6c 52 67 6e 29 0d 09 57 | 69 6e 64 6f 77 50 74 72 |lRgn)..W|indowPtr|
|000049a0| 09 77 69 6e 64 6f 77 3b | 0d 09 52 67 6e 48 61 6e |.window;|..RgnHan|
|000049b0| 64 6c 65 09 6c 6f 63 61 | 6c 52 67 6e 3b 0d 7b 0d |dle.loca|lRgn;.{.|
|000049c0| 09 43 6f 70 79 52 67 6e | 28 28 28 57 69 6e 64 6f |.CopyRgn|(((Windo|
|000049d0| 77 50 65 65 6b 29 20 77 | 69 6e 64 6f 77 29 2d 3e |wPeek) w|indow)->|
|000049e0| 75 70 64 61 74 65 52 67 | 6e 2c 20 6c 6f 63 61 6c |updateRg|n, local|
|000049f0| 52 67 6e 29 3b 09 2f 2a | 20 73 61 76 65 20 6f 6c |Rgn);./*| save ol|
|00004a00| 64 20 75 70 64 61 74 65 | 20 72 65 67 69 6f 6e 20 |d update| region |
|00004a10| 2a 2f 0d 09 4f 66 66 73 | 65 74 52 67 6e 28 6c 6f |*/..Offs|etRgn(lo|
|00004a20| 63 61 6c 52 67 6e 2c 20 | 77 69 6e 64 6f 77 2d 3e |calRgn, |window->|
|00004a30| 70 6f 72 74 42 69 74 73 | 2e 62 6f 75 6e 64 73 2e |portBits|.bounds.|
|00004a40| 6c 65 66 74 2c 20 77 69 | 6e 64 6f 77 2d 3e 70 6f |left, wi|ndow->po|
|00004a50| 72 74 42 69 74 73 2e 62 | 6f 75 6e 64 73 2e 74 6f |rtBits.b|ounds.to|
|00004a60| 70 29 3b 0d 7d 20 2f 2a | 20 47 65 74 4c 6f 63 61 |p);.} /*| GetLoca|
|00004a70| 6c 55 70 64 61 74 65 52 | 67 6e 20 2a 2f 0d 0d 0d |lUpdateR|gn */...|
|00004a80| 2f 2a 09 54 68 69 73 20 | 69 73 20 63 61 6c 6c 65 |/*.This |is calle|
|00004a90| 64 20 77 68 65 6e 20 61 | 6e 20 75 70 64 61 74 65 |d when a|n update|
|00004aa0| 20 65 76 65 6e 74 20 69 | 73 20 72 65 63 65 69 76 | event i|s receiv|
|00004ab0| 65 64 20 66 6f 72 20 61 | 20 77 69 6e 64 6f 77 2e |ed for a| window.|
|00004ac0| 0d 09 49 74 20 63 61 6c | 6c 73 20 44 72 61 77 57 |..It cal|ls DrawW|
|00004ad0| 69 6e 64 6f 77 20 74 6f | 20 64 72 61 77 20 74 68 |indow to| draw th|
|00004ae0| 65 20 63 6f 6e 74 65 6e | 74 73 20 6f 66 20 61 6e |e conten|ts of an|
|00004af0| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 20 77 69 6e | applica|tion win|
|00004b00| 64 6f 77 2e 0d 09 41 73 | 20 61 6e 20 65 66 66 69 |dow...As| an effi|
|00004b10| 63 69 65 6e 63 79 20 6d | 65 61 73 75 72 65 20 74 |ciency m|easure t|
|00004b20| 68 61 74 20 64 6f 65 73 | 20 6e 6f 74 20 68 61 76 |hat does| not hav|
|00004b30| 65 20 74 6f 20 62 65 20 | 66 6f 6c 6c 6f 77 65 64 |e to be |followed|
|00004b40| 2c 20 69 74 0d 09 63 61 | 6c 6c 73 20 74 68 65 20 |, it..ca|lls the |
|00004b50| 64 72 61 77 69 6e 67 20 | 72 6f 75 74 69 6e 65 20 |drawing |routine |
|00004b60| 6f 6e 6c 79 20 69 66 20 | 74 68 65 20 76 69 73 52 |only if |the visR|
|00004b70| 67 6e 20 69 73 20 6e 6f | 6e 2d 65 6d 70 74 79 2e |gn is no|n-empty.|
|00004b80| 20 54 68 69 73 0d 09 77 | 69 6c 6c 20 68 61 6e 64 | This..w|ill hand|
|00004b90| 6c 65 20 73 69 74 75 61 | 74 69 6f 6e 73 20 77 68 |le situa|tions wh|
|00004ba0| 65 72 65 20 63 61 6c 63 | 75 6c 61 74 69 6f 6e 73 |ere calc|ulations|
|00004bb0| 20 66 6f 72 20 64 72 61 | 77 69 6e 67 20 6f 72 20 | for dra|wing or |
|00004bc0| 64 72 61 77 69 6e 67 0d | 09 69 74 73 65 6c 66 20 |drawing.|.itself |
|00004bd0| 69 73 20 76 65 72 79 20 | 74 69 6d 65 2d 63 6f 6e |is very |time-con|
|00004be0| 73 75 6d 69 6e 67 2e 20 | 2a 2f 0d 0d 23 70 72 61 |suming. |*/..#pra|
|00004bf0| 67 6d 61 20 73 65 67 6d | 65 6e 74 20 4d 61 69 6e |gma segm|ent Main|
|00004c00| 0d 76 6f 69 64 20 44 6f | 55 70 64 61 74 65 28 77 |.void Do|Update(w|
|00004c10| 69 6e 64 6f 77 29 0d 09 | 57 69 6e 64 6f 77 50 74 |indow)..|WindowPt|
|00004c20| 72 09 77 69 6e 64 6f 77 | 3b 0d 7b 0d 09 69 66 20 |r.window|;.{..if |
|00004c30| 28 20 49 73 41 70 70 57 | 69 6e 64 6f 77 28 77 69 |( IsAppW|indow(wi|
|00004c40| 6e 64 6f 77 29 20 29 20 | 7b 0d 09 09 42 65 67 69 |ndow) ) |{...Begi|
|00004c50| 6e 55 70 64 61 74 65 28 | 77 69 6e 64 6f 77 29 3b |nUpdate(|window);|
|00004c60| 09 09 09 09 2f 2a 20 74 | 68 69 73 20 73 65 74 73 |..../* t|his sets|
|00004c70| 20 75 70 20 74 68 65 20 | 76 69 73 52 67 6e 20 2a | up the |visRgn *|
|00004c80| 2f 0d 09 09 69 66 20 28 | 20 21 20 45 6d 70 74 79 |/...if (| ! Empty|
|00004c90| 52 67 6e 28 77 69 6e 64 | 6f 77 2d 3e 76 69 73 52 |Rgn(wind|ow->visR|
|00004ca0| 67 6e 29 20 29 09 2f 2a | 20 64 72 61 77 20 69 66 |gn) )./*| draw if|
|00004cb0| 20 75 70 64 61 74 69 6e | 67 20 6e 65 65 64 73 20 | updatin|g needs |
|00004cc0| 74 6f 20 62 65 20 64 6f | 6e 65 20 2a 2f 0d 09 09 |to be do|ne */...|
|00004cd0| 09 44 72 61 77 57 69 6e | 64 6f 77 28 77 69 6e 64 |.DrawWin|dow(wind|
|00004ce0| 6f 77 29 3b 0d 09 09 45 | 6e 64 55 70 64 61 74 65 |ow);...E|ndUpdate|
|00004cf0| 28 77 69 6e 64 6f 77 29 | 3b 0d 09 7d 0d 7d 20 2f |(window)|;..}.} /|
|00004d00| 2a 44 6f 55 70 64 61 74 | 65 2a 2f 0d 0d 0d 2f 2a |*DoUpdat|e*/.../*|
|00004d10| 09 54 68 69 73 20 69 73 | 20 63 61 6c 6c 65 64 20 |.This is| called |
|00004d20| 77 68 65 6e 20 61 20 77 | 69 6e 64 6f 77 20 69 73 |when a w|indow is|
|00004d30| 20 61 63 74 69 76 61 74 | 65 64 20 6f 72 20 64 65 | activat|ed or de|
|00004d40| 61 63 74 69 76 61 74 65 | 64 2e 0d 09 49 74 20 63 |activate|d...It c|
|00004d50| 61 6c 6c 73 20 54 65 78 | 74 45 64 69 74 20 74 6f |alls Tex|tEdit to|
|00004d60| 20 64 65 61 6c 20 77 69 | 74 68 20 74 68 65 20 73 | deal wi|th the s|
|00004d70| 65 6c 65 63 74 69 6f 6e | 2e 20 2a 2f 0d 0d 23 70 |election|. */..#p|
|00004d80| 72 61 67 6d 61 20 73 65 | 67 6d 65 6e 74 20 4d 61 |ragma se|gment Ma|
|00004d90| 69 6e 0d 76 6f 69 64 20 | 44 6f 41 63 74 69 76 61 |in.void |DoActiva|
|00004da0| 74 65 28 77 69 6e 64 6f | 77 2c 20 62 65 63 6f 6d |te(windo|w, becom|
|00004db0| 69 6e 67 41 63 74 69 76 | 65 29 0d 09 57 69 6e 64 |ingActiv|e)..Wind|
|00004dc0| 6f 77 50 74 72 09 77 69 | 6e 64 6f 77 3b 0d 09 42 |owPtr.wi|ndow;..B|
|00004dd0| 6f 6f 6c 65 61 6e 09 09 | 62 65 63 6f 6d 69 6e 67 |oolean..|becoming|
|00004de0| 41 63 74 69 76 65 3b 0d | 7b 0d 09 52 67 6e 48 61 |Active;.|{..RgnHa|
|00004df0| 6e 64 6c 65 09 74 65 6d | 70 52 67 6e 2c 20 63 6c |ndle.tem|pRgn, cl|
|00004e00| 69 70 52 67 6e 3b 0d 09 | 52 65 63 74 09 09 67 72 |ipRgn;..|Rect..gr|
|00004e10| 6f 77 52 65 63 74 3b 0d | 09 44 6f 63 75 6d 65 6e |owRect;.|.Documen|
|00004e20| 74 50 65 65 6b 20 64 6f | 63 3b 0d 09 0d 09 69 66 |tPeek do|c;....if|
|00004e30| 20 28 20 49 73 41 70 70 | 57 69 6e 64 6f 77 28 77 | ( IsApp|Window(w|
|00004e40| 69 6e 64 6f 77 29 20 29 | 20 7b 0d 09 09 64 6f 63 |indow) )| {...doc|
|00004e50| 20 3d 20 28 44 6f 63 75 | 6d 65 6e 74 50 65 65 6b | = (Docu|mentPeek|
|00004e60| 29 20 77 69 6e 64 6f 77 | 3b 0d 09 09 69 66 20 28 |) window|;...if (|
|00004e70| 20 62 65 63 6f 6d 69 6e | 67 41 63 74 69 76 65 20 | becomin|gActive |
|00004e80| 29 20 7b 0d 09 09 09 2f | 2a 09 73 69 6e 63 65 20 |) {..../|*.since |
|00004e90| 77 65 20 64 6f 6e d5 74 | 20 77 61 6e 74 20 54 45 |we don.t| want TE|
|00004ea0| 41 63 74 69 76 61 74 65 | 20 74 6f 20 64 72 61 77 |Activate| to draw|
|00004eb0| 20 61 20 73 65 6c 65 63 | 74 69 6f 6e 20 69 6e 20 | a selec|tion in |
|00004ec0| 61 6e 20 61 72 65 61 20 | 77 68 65 72 65 0d 09 09 |an area |where...|
|00004ed0| 09 09 77 65 d5 72 65 20 | 67 6f 69 6e 67 20 74 6f |..we.re |going to|
|00004ee0| 20 65 72 61 73 65 20 61 | 6e 64 20 72 65 64 72 61 | erase a|nd redra|
|00004ef0| 77 2c 20 77 65 d5 6c 6c | 20 63 6c 69 70 20 6f 75 |w, we.ll| clip ou|
|00004f00| 74 20 74 68 65 20 75 70 | 64 61 74 65 20 72 65 67 |t the up|date reg|
|00004f10| 69 6f 6e 0d 09 09 09 09 | 62 65 66 6f 72 65 20 63 |ion.....|before c|
|00004f20| 61 6c 6c 69 6e 67 20 69 | 74 2e 20 2a 2f 0d 09 09 |alling i|t. */...|
|00004f30| 09 74 65 6d 70 52 67 6e | 20 3d 20 4e 65 77 52 67 |.tempRgn| = NewRg|
|00004f40| 6e 28 29 3b 0d 09 09 09 | 63 6c 69 70 52 67 6e 20 |n();....|clipRgn |
|00004f50| 3d 20 4e 65 77 52 67 6e | 28 29 3b 0d 09 09 09 47 |= NewRgn|();....G|
|00004f60| 65 74 4c 6f 63 61 6c 55 | 70 64 61 74 65 52 67 6e |etLocalU|pdateRgn|
|00004f70| 28 77 69 6e 64 6f 77 2c | 20 74 65 6d 70 52 67 6e |(window,| tempRgn|
|00004f80| 29 3b 09 09 09 2f 2a 20 | 67 65 74 20 6c 6f 63 61 |);.../* |get loca|
|00004f90| 6c 69 7a 65 64 20 75 70 | 64 61 74 65 20 72 65 67 |lized up|date reg|
|00004fa0| 69 6f 6e 20 2a 2f 0d 09 | 09 09 47 65 74 43 6c 69 |ion */..|..GetCli|
|00004fb0| 70 28 63 6c 69 70 52 67 | 6e 29 3b 0d 09 09 09 44 |p(clipRg|n);....D|
|00004fc0| 69 66 66 52 67 6e 28 63 | 6c 69 70 52 67 6e 2c 20 |iffRgn(c|lipRgn, |
|00004fd0| 74 65 6d 70 52 67 6e 2c | 20 74 65 6d 70 52 67 6e |tempRgn,| tempRgn|
|00004fe0| 29 3b 09 09 09 2f 2a 20 | 73 75 62 74 72 61 63 74 |);.../* |subtract|
|00004ff0| 20 75 70 64 61 74 65 52 | 67 6e 20 66 72 6f 6d 20 | updateR|gn from |
|00005000| 63 6c 69 70 52 67 6e 20 | 2a 2f 0d 09 09 09 53 65 |clipRgn |*/....Se|
|00005010| 74 43 6c 69 70 28 74 65 | 6d 70 52 67 6e 29 3b 0d |tClip(te|mpRgn);.|
|00005020| 09 09 09 54 45 41 63 74 | 69 76 61 74 65 28 64 6f |...TEAct|ivate(do|
|00005030| 63 2d 3e 64 6f 63 54 45 | 29 3b 0d 09 09 09 53 65 |c->docTE|);....Se|
|00005040| 74 43 6c 69 70 28 63 6c | 69 70 52 67 6e 29 3b 09 |tClip(cl|ipRgn);.|
|00005050| 09 09 09 09 09 09 2f 2a | 20 72 65 73 74 6f 72 65 |....../*| restore|
|00005060| 20 74 68 65 20 66 75 6c | 6c 2d 62 6c 6f 77 6e 20 | the ful|l-blown |
|00005070| 63 6c 69 70 52 67 6e 20 | 2a 2f 0d 09 09 09 44 69 |clipRgn |*/....Di|
|00005080| 73 70 6f 73 65 52 67 6e | 28 74 65 6d 70 52 67 6e |sposeRgn|(tempRgn|
|00005090| 29 3b 0d 09 09 09 44 69 | 73 70 6f 73 65 52 67 6e |);....Di|sposeRgn|
|000050a0| 28 63 6c 69 70 52 67 6e | 29 3b 0d 09 09 09 0d 09 |(clipRgn|);......|
|000050b0| 09 09 2f 2a 20 74 68 65 | 20 63 6f 6e 74 72 6f 6c |../* the| control|
|000050c0| 73 20 6d 75 73 74 20 62 | 65 20 72 65 64 72 61 77 |s must b|e redraw|
|000050d0| 6e 20 6f 6e 20 61 63 74 | 69 76 61 74 69 6f 6e 3a |n on act|ivation:|
|000050e0| 20 2a 2f 0d 09 09 09 28 | 2a 64 6f 63 2d 3e 64 6f | */....(|*doc->do|
|000050f0| 63 56 53 63 72 6f 6c 6c | 29 2d 3e 63 6f 6e 74 72 |cVScroll|)->contr|
|00005100| 6c 56 69 73 20 3d 20 6b | 43 6f 6e 74 72 6f 6c 56 |lVis = k|ControlV|
|00005110| 69 73 69 62 6c 65 3b 0d | 09 09 09 28 2a 64 6f 63 |isible;.|...(*doc|
|00005120| 2d 3e 64 6f 63 48 53 63 | 72 6f 6c 6c 29 2d 3e 63 |->docHSc|roll)->c|
|00005130| 6f 6e 74 72 6c 56 69 73 | 20 3d 20 6b 43 6f 6e 74 |ontrlVis| = kCont|
|00005140| 72 6f 6c 56 69 73 69 62 | 6c 65 3b 0d 09 09 09 49 |rolVisib|le;....I|
|00005150| 6e 76 61 6c 52 65 63 74 | 28 26 28 2a 64 6f 63 2d |nvalRect|(&(*doc-|
|00005160| 3e 64 6f 63 56 53 63 72 | 6f 6c 6c 29 2d 3e 63 6f |>docVScr|oll)->co|
|00005170| 6e 74 72 6c 52 65 63 74 | 29 3b 0d 09 09 09 49 6e |ntrlRect|);....In|
|00005180| 76 61 6c 52 65 63 74 28 | 26 28 2a 64 6f 63 2d 3e |valRect(|&(*doc->|
|00005190| 64 6f 63 48 53 63 72 6f | 6c 6c 29 2d 3e 63 6f 6e |docHScro|ll)->con|
|000051a0| 74 72 6c 52 65 63 74 29 | 3b 0d 09 09 09 2f 2a 20 |trlRect)|;..../* |
|000051b0| 74 68 65 20 67 72 6f 77 | 62 6f 78 20 6e 65 65 64 |the grow|box need|
|000051c0| 73 20 74 6f 20 62 65 20 | 72 65 64 72 61 77 6e 20 |s to be |redrawn |
|000051d0| 6f 6e 20 61 63 74 69 76 | 61 74 69 6f 6e 3a 20 2a |on activ|ation: *|
|000051e0| 2f 0d 09 09 09 67 72 6f | 77 52 65 63 74 20 3d 20 |/....gro|wRect = |
|000051f0| 77 69 6e 64 6f 77 2d 3e | 70 6f 72 74 52 65 63 74 |window->|portRect|
|00005200| 3b 0d 09 09 09 2f 2a 20 | 61 64 6a 75 73 74 20 66 |;..../* |adjust f|
|00005210| 6f 72 20 74 68 65 20 73 | 63 72 6f 6c 6c 62 61 72 |or the s|crollbar|
|00005220| 73 20 2a 2f 0d 09 09 09 | 67 72 6f 77 52 65 63 74 |s */....|growRect|
|00005230| 2e 74 6f 70 20 3d 20 67 | 72 6f 77 52 65 63 74 2e |.top = g|rowRect.|
|00005240| 62 6f 74 74 6f 6d 20 2d | 20 6b 53 63 72 6f 6c 6c |bottom -| kScroll|
|00005250| 62 61 72 41 64 6a 75 73 | 74 3b 0d 09 09 09 67 72 |barAdjus|t;....gr|
|00005260| 6f 77 52 65 63 74 2e 6c | 65 66 74 20 3d 20 67 72 |owRect.l|eft = gr|
|00005270| 6f 77 52 65 63 74 2e 72 | 69 67 68 74 20 2d 20 6b |owRect.r|ight - k|
|00005280| 53 63 72 6f 6c 6c 62 61 | 72 41 64 6a 75 73 74 3b |Scrollba|rAdjust;|
|00005290| 0d 09 09 09 49 6e 76 61 | 6c 52 65 63 74 28 26 67 |....Inva|lRect(&g|
|000052a0| 72 6f 77 52 65 63 74 29 | 3b 0d 09 09 7d 0d 09 09 |rowRect)|;...}...|
|000052b0| 65 6c 73 65 20 7b 09 09 | 0d 09 09 09 54 45 44 65 |else {..|....TEDe|
|000052c0| 61 63 74 69 76 61 74 65 | 28 64 6f 63 2d 3e 64 6f |activate|(doc->do|
|000052d0| 63 54 45 29 3b 0d 09 09 | 09 2f 2a 20 74 68 65 20 |cTE);...|./* the |
|000052e0| 63 6f 6e 74 72 6f 6c 73 | 20 6d 75 73 74 20 62 65 |controls| must be|
|000052f0| 20 68 69 64 64 65 6e 20 | 6f 6e 20 64 65 61 63 74 | hidden |on deact|
|00005300| 69 76 61 74 69 6f 6e 3a | 20 2a 2f 0d 09 09 09 48 |ivation:| */....H|
|00005310| 69 64 65 43 6f 6e 74 72 | 6f 6c 28 64 6f 63 2d 3e |ideContr|ol(doc->|
|00005320| 64 6f 63 56 53 63 72 6f | 6c 6c 29 3b 0d 09 09 09 |docVScro|ll);....|
|00005330| 48 69 64 65 43 6f 6e 74 | 72 6f 6c 28 64 6f 63 2d |HideCont|rol(doc-|
|00005340| 3e 64 6f 63 48 53 63 72 | 6f 6c 6c 29 3b 0d 09 09 |>docHScr|oll);...|
|00005350| 09 2f 2a 20 74 68 65 20 | 67 72 6f 77 62 6f 78 20 |./* the |growbox |
|00005360| 73 68 6f 75 6c 64 20 62 | 65 20 63 68 61 6e 67 65 |should b|e change|
|00005370| 64 20 69 6d 6d 65 64 69 | 61 74 65 6c 79 20 6f 6e |d immedi|ately on|
|00005380| 20 64 65 61 63 74 69 76 | 61 74 69 6f 6e 3a 20 2a | deactiv|ation: *|
|00005390| 2f 0d 09 09 09 44 72 61 | 77 47 72 6f 77 49 63 6f |/....Dra|wGrowIco|
|000053a0| 6e 28 77 69 6e 64 6f 77 | 29 3b 0d 09 09 7d 0d 09 |n(window|);...}..|
|000053b0| 7d 0d 7d 20 2f 2a 44 6f | 41 63 74 69 76 61 74 65 |}.} /*Do|Activate|
|000053c0| 2a 2f 0d 0d 0d 2f 2a 09 | 54 68 69 73 20 69 73 20 |*/.../*.|This is |
|000053d0| 63 61 6c 6c 65 64 20 77 | 68 65 6e 20 61 20 6d 6f |called w|hen a mo|
|000053e0| 75 73 65 44 6f 77 6e 20 | 6f 63 63 75 72 73 20 69 |useDown |occurs i|
|000053f0| 6e 20 74 68 65 20 63 6f | 6e 74 65 6e 74 20 6f 66 |n the co|ntent of|
|00005400| 20 61 20 77 69 6e 64 6f | 77 2e 20 2a 2f 0d 0d 23 | a windo|w. */..#|
|00005410| 70 72 61 67 6d 61 20 73 | 65 67 6d 65 6e 74 20 4d |pragma s|egment M|
|00005420| 61 69 6e 0d 76 6f 69 64 | 20 44 6f 43 6f 6e 74 65 |ain.void| DoConte|
|00005430| 6e 74 43 6c 69 63 6b 28 | 77 69 6e 64 6f 77 2c 65 |ntClick(|window,e|
|00005440| 76 65 6e 74 29 0d 09 57 | 69 6e 64 6f 77 50 74 72 |vent)..W|indowPtr|
|00005450| 09 77 69 6e 64 6f 77 3b | 0d 09 45 76 65 6e 74 52 |.window;|..EventR|
|00005460| 65 63 6f 72 64 09 2a 65 | 76 65 6e 74 3b 0d 7b 0d |ecord.*e|vent;.{.|
|00005470| 09 50 6f 69 6e 74 09 09 | 6d 6f 75 73 65 3b 0d 09 |.Point..|mouse;..|
|00005480| 43 6f 6e 74 72 6f 6c 48 | 61 6e 64 6c 65 20 63 6f |ControlH|andle co|
|00005490| 6e 74 72 6f 6c 3b 0d 09 | 73 68 6f 72 74 09 09 70 |ntrol;..|short..p|
|000054a0| 61 72 74 2c 20 76 61 6c | 75 65 3b 0d 09 42 6f 6f |art, val|ue;..Boo|
|000054b0| 6c 65 61 6e 09 09 73 68 | 69 66 74 44 6f 77 6e 3b |lean..sh|iftDown;|
|000054c0| 0d 09 44 6f 63 75 6d 65 | 6e 74 50 65 65 6b 20 64 |..Docume|ntPeek d|
|000054d0| 6f 63 3b 0d 09 52 65 63 | 74 09 09 74 65 52 65 63 |oc;..Rec|t..teRec|
|000054e0| 74 3b 0d 0d 09 69 66 20 | 28 20 49 73 41 70 70 57 |t;...if |( IsAppW|
|000054f0| 69 6e 64 6f 77 28 77 69 | 6e 64 6f 77 29 20 29 20 |indow(wi|ndow) ) |
|00005500| 7b 0d 09 09 53 65 74 50 | 6f 72 74 28 77 69 6e 64 |{...SetP|ort(wind|
|00005510| 6f 77 29 3b 0d 09 09 6d | 6f 75 73 65 20 3d 20 65 |ow);...m|ouse = e|
|00005520| 76 65 6e 74 2d 3e 77 68 | 65 72 65 3b 09 09 09 09 |vent->wh|ere;....|
|00005530| 09 09 09 2f 2a 20 67 65 | 74 20 74 68 65 20 63 6c |.../* ge|t the cl|
|00005540| 69 63 6b 20 70 6f 73 69 | 74 69 6f 6e 20 2a 2f 0d |ick posi|tion */.|
|00005550| 09 09 47 6c 6f 62 61 6c | 54 6f 4c 6f 63 61 6c 28 |..Global|ToLocal(|
|00005560| 26 6d 6f 75 73 65 29 3b | 0d 09 09 64 6f 63 20 3d |&mouse);|...doc =|
|00005570| 20 28 44 6f 63 75 6d 65 | 6e 74 50 65 65 6b 29 20 | (Docume|ntPeek) |
|00005580| 77 69 6e 64 6f 77 3b 0d | 09 09 2f 2a 20 73 65 65 |window;.|../* see|
|00005590| 20 69 66 20 77 65 20 61 | 72 65 20 69 6e 20 74 68 | if we a|re in th|
|000055a0| 65 20 76 69 65 77 52 65 | 63 74 2e 20 69 66 20 73 |e viewRe|ct. if s|
|000055b0| 6f 2c 20 77 65 20 77 6f | 6e d5 74 20 63 68 65 63 |o, we wo|n.t chec|
|000055c0| 6b 20 74 68 65 20 63 6f | 6e 74 72 6f 6c 73 20 2a |k the co|ntrols *|
|000055d0| 2f 0d 09 09 47 65 74 54 | 45 52 65 63 74 28 77 69 |/...GetT|ERect(wi|
|000055e0| 6e 64 6f 77 2c 20 26 74 | 65 52 65 63 74 29 3b 0d |ndow, &t|eRect);.|
|000055f0| 09 09 69 66 20 28 20 50 | 74 49 6e 52 65 63 74 28 |..if ( P|tInRect(|
|00005600| 6d 6f 75 73 65 2c 20 26 | 74 65 52 65 63 74 29 20 |mouse, &|teRect) |
|00005610| 29 20 7b 0d 09 09 09 2f | 2a 20 73 65 65 20 69 66 |) {..../|* see if|
|00005620| 20 77 65 20 6e 65 65 64 | 20 74 6f 20 65 78 74 65 | we need| to exte|
|00005630| 6e 64 20 74 68 65 20 73 | 65 6c 65 63 74 69 6f 6e |nd the s|election|
|00005640| 20 2a 2f 0d 09 09 09 73 | 68 69 66 74 44 6f 77 6e | */....s|hiftDown|
|00005650| 20 3d 20 28 65 76 65 6e | 74 2d 3e 6d 6f 64 69 66 | = (even|t->modif|
|00005660| 69 65 72 73 20 26 20 73 | 68 69 66 74 4b 65 79 29 |iers & s|hiftKey)|
|00005670| 20 21 3d 20 30 3b 09 2f | 2a 20 65 78 74 65 6e 64 | != 0;./|* extend|
|00005680| 20 69 66 20 53 68 69 66 | 74 20 69 73 20 64 6f 77 | if Shif|t is dow|
|00005690| 6e 20 2a 2f 0d 09 09 09 | 54 45 43 6c 69 63 6b 28 |n */....|TEClick(|
|000056a0| 6d 6f 75 73 65 2c 20 73 | 68 69 66 74 44 6f 77 6e |mouse, s|hiftDown|
|000056b0| 2c 20 64 6f 63 2d 3e 64 | 6f 63 54 45 29 3b 0d 09 |, doc->d|ocTE);..|
|000056c0| 09 7d 20 65 6c 73 65 20 | 7b 0d 09 09 09 70 61 72 |.} else |{....par|
|000056d0| 74 20 3d 20 46 69 6e 64 | 43 6f 6e 74 72 6f 6c 28 |t = Find|Control(|
|000056e0| 6d 6f 75 73 65 2c 20 77 | 69 6e 64 6f 77 2c 20 26 |mouse, w|indow, &|
|000056f0| 63 6f 6e 74 72 6f 6c 29 | 3b 0d 09 09 09 73 77 69 |control)|;....swi|
|00005700| 74 63 68 20 28 20 70 61 | 72 74 20 29 20 7b 0d 09 |tch ( pa|rt ) {..|
|00005710| 09 09 09 63 61 73 65 20 | 30 3a 09 09 09 09 09 09 |...case |0:......|
|00005720| 09 2f 2a 20 64 6f 20 6e | 6f 74 68 69 6e 67 20 66 |./* do n|othing f|
|00005730| 6f 72 20 76 69 65 77 52 | 65 63 74 20 63 61 73 65 |or viewR|ect case|
|00005740| 20 2a 2f 0d 09 09 09 09 | 09 62 72 65 61 6b 3b 0d | */.....|.break;.|
|00005750| 09 09 09 09 63 61 73 65 | 20 69 6e 54 68 75 6d 62 |....case| inThumb|
|00005760| 3a 0d 09 09 09 09 09 76 | 61 6c 75 65 20 3d 20 47 |:......v|alue = G|
|00005770| 65 74 43 74 6c 56 61 6c | 75 65 28 63 6f 6e 74 72 |etCtlVal|ue(contr|
|00005780| 6f 6c 29 3b 0d 09 09 09 | 09 09 70 61 72 74 20 3d |ol);....|..part =|
|00005790| 20 54 72 61 63 6b 43 6f | 6e 74 72 6f 6c 28 63 6f | TrackCo|ntrol(co|
|000057a0| 6e 74 72 6f 6c 2c 20 6d | 6f 75 73 65 2c 20 6e 69 |ntrol, m|ouse, ni|
|000057b0| 6c 29 3b 0d 09 09 09 09 | 09 69 66 20 28 20 70 61 |l);.....|.if ( pa|
|000057c0| 72 74 20 21 3d 20 30 20 | 29 20 7b 0d 09 09 09 09 |rt != 0 |) {.....|
|000057d0| 09 09 76 61 6c 75 65 20 | 2d 3d 20 47 65 74 43 74 |..value |-= GetCt|
|000057e0| 6c 56 61 6c 75 65 28 63 | 6f 6e 74 72 6f 6c 29 3b |lValue(c|ontrol);|
|000057f0| 0d 09 09 09 09 09 09 2f | 2a 20 76 61 6c 75 65 20 |......./|* value |
|00005800| 6e 6f 77 20 68 61 73 20 | 43 48 41 4e 47 45 20 69 |now has |CHANGE i|
|00005810| 6e 20 76 61 6c 75 65 3b | 20 69 66 20 76 61 6c 75 |n value;| if valu|
|00005820| 65 20 63 68 61 6e 67 65 | 64 2c 20 73 63 72 6f 6c |e change|d, scrol|
|00005830| 6c 20 2a 2f 0d 09 09 09 | 09 09 09 69 66 20 28 20 |l */....|...if ( |
|00005840| 76 61 6c 75 65 20 21 3d | 20 30 20 29 0d 09 09 09 |value !=| 0 )....|
|00005850| 09 09 09 09 69 66 20 28 | 20 63 6f 6e 74 72 6f 6c |....if (| control|
|00005860| 20 3d 3d 20 64 6f 63 2d | 3e 64 6f 63 56 53 63 72 | == doc-|>docVScr|
|00005870| 6f 6c 6c 20 29 0d 09 09 | 09 09 09 09 09 09 54 45 |oll )...|......TE|
|00005880| 53 63 72 6f 6c 6c 28 30 | 2c 20 76 61 6c 75 65 20 |Scroll(0|, value |
|00005890| 2a 20 28 2a 64 6f 63 2d | 3e 64 6f 63 54 45 29 2d |* (*doc-|>docTE)-|
|000058a0| 3e 6c 69 6e 65 48 65 69 | 67 68 74 2c 20 64 6f 63 |>lineHei|ght, doc|
|000058b0| 2d 3e 64 6f 63 54 45 29 | 3b 0d 09 09 09 09 09 09 |->docTE)|;.......|
|000058c0| 09 65 6c 73 65 0d 09 09 | 09 09 09 09 09 09 54 45 |.else...|......TE|
|000058d0| 53 63 72 6f 6c 6c 28 76 | 61 6c 75 65 2c 20 30 2c |Scroll(v|alue, 0,|
|000058e0| 20 64 6f 63 2d 3e 64 6f | 63 54 45 29 3b 0d 09 09 | doc->do|cTE);...|
|000058f0| 09 09 09 7d 0d 09 09 09 | 09 09 62 72 65 61 6b 3b |...}....|..break;|
|00005900| 0d 09 09 09 09 64 65 66 | 61 75 6c 74 3a 09 09 09 |.....def|ault:...|
|00005910| 09 09 09 2f 2a 20 74 68 | 65 79 20 63 6c 69 63 6b |.../* th|ey click|
|00005920| 65 64 20 69 6e 20 61 6e | 20 61 72 72 6f 77 2c 20 |ed in an| arrow, |
|00005930| 73 6f 20 74 72 61 63 6b | 20 26 20 73 63 72 6f 6c |so track| & scrol|
|00005940| 6c 20 2a 2f 0d 09 09 09 | 09 09 69 66 20 28 20 63 |l */....|..if ( c|
|00005950| 6f 6e 74 72 6f 6c 20 3d | 3d 20 64 6f 63 2d 3e 64 |ontrol =|= doc->d|
|00005960| 6f 63 56 53 63 72 6f 6c | 6c 20 29 0d 09 09 09 09 |ocVScrol|l ).....|
|00005970| 09 09 76 61 6c 75 65 20 | 3d 20 54 72 61 63 6b 43 |..value |= TrackC|
|00005980| 6f 6e 74 72 6f 6c 28 63 | 6f 6e 74 72 6f 6c 2c 20 |ontrol(c|ontrol, |
|00005990| 6d 6f 75 73 65 2c 20 28 | 50 72 6f 63 50 74 72 29 |mouse, (|ProcPtr)|
|000059a0| 20 56 41 63 74 69 6f 6e | 50 72 6f 63 29 3b 0d 09 | VAction|Proc);..|
|000059b0| 09 09 09 09 65 6c 73 65 | 0d 09 09 09 09 09 09 76 |....else|.......v|
|000059c0| 61 6c 75 65 20 3d 20 54 | 72 61 63 6b 43 6f 6e 74 |alue = T|rackCont|
|000059d0| 72 6f 6c 28 63 6f 6e 74 | 72 6f 6c 2c 20 6d 6f 75 |rol(cont|rol, mou|
|000059e0| 73 65 2c 20 28 50 72 6f | 63 50 74 72 29 20 48 41 |se, (Pro|cPtr) HA|
|000059f0| 63 74 69 6f 6e 50 72 6f | 63 29 3b 0d 09 09 09 09 |ctionPro|c);.....|
|00005a00| 09 62 72 65 61 6b 3b 0d | 09 09 09 7d 0d 09 09 7d |.break;.|...}...}|
|00005a10| 0d 09 7d 0d 7d 20 2f 2a | 44 6f 43 6f 6e 74 65 6e |..}.} /*|DoConten|
|00005a20| 74 43 6c 69 63 6b 2a 2f | 0d 0d 0d 2f 2a 20 54 68 |tClick*/|.../* Th|
|00005a30| 69 73 20 69 73 20 63 61 | 6c 6c 65 64 20 66 6f 72 |is is ca|lled for|
|00005a40| 20 61 6e 79 20 6b 65 79 | 44 6f 77 6e 20 6f 72 20 | any key|Down or |
|00005a50| 61 75 74 6f 4b 65 79 20 | 65 76 65 6e 74 73 2c 20 |autoKey |events, |
|00005a60| 65 78 63 65 70 74 20 77 | 68 65 6e 20 74 68 65 0d |except w|hen the.|
|00005a70| 20 43 6f 6d 6d 61 6e 64 | 20 6b 65 79 20 69 73 20 | Command| key is |
|00005a80| 68 65 6c 64 20 64 6f 77 | 6e 2e 20 49 74 20 6c 6f |held dow|n. It lo|
|00005a90| 6f 6b 73 20 61 74 20 74 | 68 65 20 66 72 6f 6e 74 |oks at t|he front|
|00005aa0| 6d 6f 73 74 20 77 69 6e | 64 6f 77 20 74 6f 20 64 |most win|dow to d|
|00005ab0| 65 63 69 64 65 20 77 68 | 61 74 0d 20 74 6f 20 64 |ecide wh|at. to d|
|00005ac0| 6f 20 77 69 74 68 20 74 | 68 65 20 6b 65 79 20 74 |o with t|he key t|
|00005ad0| 79 70 65 64 2e 20 2a 2f | 0d 0d 23 70 72 61 67 6d |yped. */|..#pragm|
|00005ae0| 61 20 73 65 67 6d 65 6e | 74 20 4d 61 69 6e 0d 76 |a segmen|t Main.v|
|00005af0| 6f 69 64 20 44 6f 4b 65 | 79 44 6f 77 6e 28 65 76 |oid DoKe|yDown(ev|
|00005b00| 65 6e 74 29 0d 09 45 76 | 65 6e 74 52 65 63 6f 72 |ent)..Ev|entRecor|
|00005b10| 64 09 2a 65 76 65 6e 74 | 3b 0d 7b 0d 09 57 69 6e |d.*event|;.{..Win|
|00005b20| 64 6f 77 50 74 72 09 77 | 69 6e 64 6f 77 3b 0d 09 |dowPtr.w|indow;..|
|00005b30| 63 68 61 72 09 09 6b 65 | 79 3b 0d 09 54 45 48 61 |char..ke|y;..TEHa|
|00005b40| 6e 64 6c 65 09 74 65 3b | 0d 0d 09 77 69 6e 64 6f |ndle.te;|...windo|
|00005b50| 77 20 3d 20 46 72 6f 6e | 74 57 69 6e 64 6f 77 28 |w = Fron|tWindow(|
|00005b60| 29 3b 0d 09 69 66 20 28 | 20 49 73 41 70 70 57 69 |);..if (| IsAppWi|
|00005b70| 6e 64 6f 77 28 77 69 6e | 64 6f 77 29 20 29 20 7b |ndow(win|dow) ) {|
|00005b80| 0d 09 09 74 65 20 3d 20 | 28 28 44 6f 63 75 6d 65 |...te = |((Docume|
|00005b90| 6e 74 50 65 65 6b 29 20 | 77 69 6e 64 6f 77 29 2d |ntPeek) |window)-|
|00005ba0| 3e 64 6f 63 54 45 3b 0d | 09 09 6b 65 79 20 3d 20 |>docTE;.|..key = |
|00005bb0| 65 76 65 6e 74 2d 3e 6d | 65 73 73 61 67 65 20 26 |event->m|essage &|
|00005bc0| 20 63 68 61 72 43 6f 64 | 65 4d 61 73 6b 3b 0d 09 | charCod|eMask;..|
|00005bd0| 09 2f 2a 20 77 65 20 68 | 61 76 65 20 61 20 63 68 |./* we h|ave a ch|
|00005be0| 61 72 2e 20 66 6f 72 20 | 6f 75 72 20 77 69 6e 64 |ar. for |our wind|
|00005bf0| 6f 77 3b 20 73 65 65 20 | 69 66 20 77 65 20 61 72 |ow; see |if we ar|
|00005c00| 65 20 73 74 69 6c 6c 20 | 62 65 6c 6f 77 20 54 65 |e still |below Te|
|00005c10| 78 74 45 64 69 74 d5 73 | 0d 09 09 09 6c 69 6d 69 |xtEdit.s|....limi|
|00005c20| 74 20 66 6f 72 20 74 68 | 65 20 6e 75 6d 62 65 72 |t for th|e number|
|00005c30| 20 6f 66 20 63 68 61 72 | 61 63 74 65 72 73 20 28 | of char|acters (|
|00005c40| 62 75 74 20 64 65 6c 65 | 74 65 73 20 61 72 65 20 |but dele|tes are |
|00005c50| 61 6c 77 61 79 73 20 72 | 61 64 29 20 2a 2f 0d 09 |always r|ad) */..|
|00005c60| 09 69 66 20 28 20 6b 65 | 79 20 3d 3d 20 6b 44 65 |.if ( ke|y == kDe|
|00005c70| 6c 43 68 61 72 20 7c 7c | 0d 09 09 09 09 28 2a 74 |lChar |||.....(*t|
|00005c80| 65 29 2d 3e 74 65 4c 65 | 6e 67 74 68 20 2d 20 28 |e)->teLe|ngth - (|
|00005c90| 28 2a 74 65 29 2d 3e 73 | 65 6c 45 6e 64 20 2d 20 |(*te)->s|elEnd - |
|00005ca0| 28 2a 74 65 29 2d 3e 73 | 65 6c 53 74 61 72 74 29 |(*te)->s|elStart)|
|00005cb0| 20 2b 20 31 20 3c 0d 09 | 09 09 09 6b 4d 61 78 54 | + 1 <..|...kMaxT|
|00005cc0| 45 4c 65 6e 67 74 68 20 | 29 20 7b 0d 09 09 09 54 |ELength |) {....T|
|00005cd0| 45 4b 65 79 28 6b 65 79 | 2c 20 74 65 29 3b 0d 09 |EKey(key|, te);..|
|00005ce0| 09 09 41 64 6a 75 73 74 | 53 63 72 6f 6c 6c 62 61 |..Adjust|Scrollba|
|00005cf0| 72 73 28 77 69 6e 64 6f | 77 2c 20 66 61 6c 73 65 |rs(windo|w, false|
|00005d00| 29 3b 0d 09 09 09 41 64 | 6a 75 73 74 54 45 28 77 |);....Ad|justTE(w|
|00005d10| 69 6e 64 6f 77 29 3b 0d | 09 09 7d 20 65 6c 73 65 |indow);.|..} else|
|00005d20| 0d 09 09 09 41 6c 65 72 | 74 55 73 65 72 28 65 45 |....Aler|tUser(eE|
|00005d30| 78 63 65 65 64 43 68 61 | 72 29 3b 0d 09 7d 0d 7d |xceedCha|r);..}.}|
|00005d40| 20 2f 2a 44 6f 4b 65 79 | 44 6f 77 6e 2a 2f 0d 0d | /*DoKey|Down*/..|
|00005d50| 0d 2f 2a 09 43 61 6c 63 | 75 6c 61 74 65 20 61 20 |./*.Calc|ulate a |
|00005d60| 73 6c 65 65 70 20 76 61 | 6c 75 65 20 66 6f 72 20 |sleep va|lue for |
|00005d70| 57 61 69 74 4e 65 78 74 | 45 76 65 6e 74 2e 20 54 |WaitNext|Event. T|
|00005d80| 68 69 73 20 74 61 6b 65 | 73 20 69 6e 74 6f 20 61 |his take|s into a|
|00005d90| 63 63 6f 75 6e 74 20 74 | 68 65 20 74 68 69 6e 67 |ccount t|he thing|
|00005da0| 73 0d 09 74 68 61 74 20 | 44 6f 49 64 6c 65 20 64 |s..that |DoIdle d|
|00005db0| 6f 65 73 20 77 69 74 68 | 20 69 64 6c 65 20 74 69 |oes with| idle ti|
|00005dc0| 6d 65 2e 20 2a 2f 0d 0d | 23 70 72 61 67 6d 61 20 |me. */..|#pragma |
|00005dd0| 73 65 67 6d 65 6e 74 20 | 4d 61 69 6e 0d 75 6e 73 |segment |Main.uns|
|00005de0| 69 67 6e 65 64 20 6c 6f | 6e 67 20 47 65 74 53 6c |igned lo|ng GetSl|
|00005df0| 65 65 70 28 29 0d 7b 0d | 09 6c 6f 6e 67 09 09 73 |eep().{.|.long..s|
|00005e00| 6c 65 65 70 3b 0d 09 57 | 69 6e 64 6f 77 50 74 72 |leep;..W|indowPtr|
|00005e10| 09 77 69 6e 64 6f 77 3b | 0d 09 54 45 48 61 6e 64 |.window;|..TEHand|
|00005e20| 6c 65 09 74 65 3b 0d 0d | 09 73 6c 65 65 70 20 3d |le.te;..|.sleep =|
|00005e30| 20 4d 41 58 4c 4f 4e 47 | 3b 09 09 09 09 09 09 2f | MAXLONG|;....../|
|00005e40| 2a 20 64 65 66 61 75 6c | 74 20 76 61 6c 75 65 20 |* defaul|t value |
|00005e50| 66 6f 72 20 73 6c 65 65 | 70 20 2a 2f 0d 09 69 66 |for slee|p */..if|
|00005e60| 20 28 20 21 67 49 6e 42 | 61 63 6b 67 72 6f 75 6e | ( !gInB|ackgroun|
|00005e70| 64 20 29 20 7b 0d 09 09 | 77 69 6e 64 6f 77 20 3d |d ) {...|window =|
|00005e80| 20 46 72 6f 6e 74 57 69 | 6e 64 6f 77 28 29 3b 09 | FrontWi|ndow();.|
|00005e90| 09 09 2f 2a 20 61 6e 64 | 20 74 68 65 20 66 72 6f |../* and| the fro|
|00005ea0| 6e 74 20 77 69 6e 64 6f | 77 20 69 73 20 6f 75 72 |nt windo|w is our|
|00005eb0| 73 2e 2e 2e 20 2a 2f 0d | 09 09 69 66 20 28 20 49 |s... */.|..if ( I|
|00005ec0| 73 41 70 70 57 69 6e 64 | 6f 77 28 77 69 6e 64 6f |sAppWind|ow(windo|
|00005ed0| 77 29 20 29 20 7b 0d 09 | 09 09 74 65 20 3d 20 28 |w) ) {..|..te = (|
|00005ee0| 28 44 6f 63 75 6d 65 6e | 74 50 65 65 6b 29 20 28 |(Documen|tPeek) (|
|00005ef0| 77 69 6e 64 6f 77 29 29 | 2d 3e 64 6f 63 54 45 3b |window))|->docTE;|
|00005f00| 09 2f 2a 20 61 6e 64 20 | 74 68 65 20 73 65 6c 65 |./* and |the sele|
|00005f10| 63 74 69 6f 6e 20 69 73 | 20 61 6e 20 69 6e 73 65 |ction is| an inse|
|00005f20| 72 74 69 6f 6e 20 70 6f | 69 6e 74 2e 2e 2e 20 2a |rtion po|int... *|
|00005f30| 2f 0d 09 09 09 69 66 20 | 28 20 28 2a 74 65 29 2d |/....if |( (*te)-|
|00005f40| 3e 73 65 6c 53 74 61 72 | 74 20 3d 3d 20 28 2a 74 |>selStar|t == (*t|
|00005f50| 65 29 2d 3e 73 65 6c 45 | 6e 64 20 29 0d 09 09 09 |e)->selE|nd )....|
|00005f60| 09 73 6c 65 65 70 20 3d | 20 47 65 74 43 61 72 65 |.sleep =| GetCare|
|00005f70| 74 54 69 6d 65 28 29 3b | 09 09 2f 2a 20 62 6c 69 |tTime();|../* bli|
|00005f80| 6e 6b 20 74 69 6d 65 20 | 66 6f 72 20 74 68 65 20 |nk time |for the |
|00005f90| 69 6e 73 65 72 74 69 6f | 6e 20 70 6f 69 6e 74 20 |insertio|n point |
|00005fa0| 2a 2f 0d 09 09 7d 0d 09 | 7d 0d 09 72 65 74 75 72 |*/...}..|}..retur|
|00005fb0| 6e 20 73 6c 65 65 70 3b | 0d 7d 20 2f 2a 47 65 74 |n sleep;|.} /*Get|
|00005fc0| 53 6c 65 65 70 2a 2f 0d | 0d 0d 2f 2a 09 43 6f 6d |Sleep*/.|../*.Com|
|00005fd0| 6d 6f 6e 20 61 6c 67 6f | 72 69 74 68 6d 20 66 6f |mon algo|rithm fo|
|00005fe0| 72 20 70 69 6e 6e 69 6e | 67 20 74 68 65 20 76 61 |r pinnin|g the va|
|00005ff0| 6c 75 65 20 6f 66 20 61 | 20 63 6f 6e 74 72 6f 6c |lue of a| control|
|00006000| 2e 20 49 74 20 72 65 74 | 75 72 6e 73 20 74 68 65 |. It ret|urns the|
|00006010| 20 61 63 74 75 61 6c 20 | 61 6d 6f 75 6e 74 0d 09 | actual |amount..|
|00006020| 74 68 65 20 76 61 6c 75 | 65 20 6f 66 20 74 68 65 |the valu|e of the|
|00006030| 20 63 6f 6e 74 72 6f 6c | 20 63 68 61 6e 67 65 64 | control| changed|
|00006040| 2e 20 4e 6f 74 65 20 74 | 68 65 20 70 69 6e 6e 69 |. Note t|he pinni|
|00006050| 6e 67 20 69 73 20 64 6f | 6e 65 20 66 6f 72 20 74 |ng is do|ne for t|
|00006060| 68 65 20 73 61 6b 65 20 | 6f 66 20 72 65 74 75 72 |he sake |of retur|
|00006070| 6e 69 6e 67 0d 09 74 68 | 65 20 61 6d 6f 75 6e 74 |ning..th|e amount|
|00006080| 20 74 68 65 20 63 6f 6e | 74 72 6f 6c 20 76 61 6c | the con|trol val|
|00006090| 75 65 20 63 68 61 6e 67 | 65 64 2e 20 2a 2f 0d 0d |ue chang|ed. */..|
|000060a0| 23 70 72 61 67 6d 61 20 | 73 65 67 6d 65 6e 74 20 |#pragma |segment |
|000060b0| 4d 61 69 6e 0d 76 6f 69 | 64 20 43 6f 6d 6d 6f 6e |Main.voi|d Common|
|000060c0| 41 63 74 69 6f 6e 28 63 | 6f 6e 74 72 6f 6c 2c 61 |Action(c|ontrol,a|
|000060d0| 6d 6f 75 6e 74 29 0d 09 | 43 6f 6e 74 72 6f 6c 48 |mount)..|ControlH|
|000060e0| 61 6e 64 6c 65 20 63 6f | 6e 74 72 6f 6c 3b 0d 09 |andle co|ntrol;..|
|000060f0| 73 68 6f 72 74 09 09 2a | 61 6d 6f 75 6e 74 3b 0d |short..*|amount;.|
|00006100| 7b 0d 09 73 68 6f 72 74 | 09 09 76 61 6c 75 65 2c |{..short|..value,|
|00006110| 20 6d 61 78 3b 0d 09 0d | 09 76 61 6c 75 65 20 3d | max;...|.value =|
|00006120| 20 47 65 74 43 74 6c 56 | 61 6c 75 65 28 63 6f 6e | GetCtlV|alue(con|
|00006130| 74 72 6f 6c 29 3b 09 2f | 2a 20 67 65 74 20 63 75 |trol);./|* get cu|
|00006140| 72 72 65 6e 74 20 76 61 | 6c 75 65 20 2a 2f 0d 09 |rrent va|lue */..|
|00006150| 6d 61 78 20 3d 20 47 65 | 74 43 74 6c 4d 61 78 28 |max = Ge|tCtlMax(|
|00006160| 63 6f 6e 74 72 6f 6c 29 | 3b 09 09 2f 2a 20 61 6e |control)|;../* an|
|00006170| 64 20 6d 61 78 69 6d 75 | 6d 20 76 61 6c 75 65 20 |d maximu|m value |
|00006180| 2a 2f 0d 09 2a 61 6d 6f | 75 6e 74 20 3d 20 76 61 |*/..*amo|unt = va|
|00006190| 6c 75 65 20 2d 20 2a 61 | 6d 6f 75 6e 74 3b 0d 09 |lue - *a|mount;..|
|000061a0| 69 66 20 28 20 2a 61 6d | 6f 75 6e 74 20 3c 20 30 |if ( *am|ount < 0|
|000061b0| 20 29 0d 09 09 2a 61 6d | 6f 75 6e 74 20 3d 20 30 | )...*am|ount = 0|
|000061c0| 3b 0d 09 65 6c 73 65 20 | 69 66 20 28 20 2a 61 6d |;..else |if ( *am|
|000061d0| 6f 75 6e 74 20 3e 20 6d | 61 78 20 29 0d 09 09 2a |ount > m|ax )...*|
|000061e0| 61 6d 6f 75 6e 74 20 3d | 20 6d 61 78 3b 0d 09 53 |amount =| max;..S|
|000061f0| 65 74 43 74 6c 56 61 6c | 75 65 28 63 6f 6e 74 72 |etCtlVal|ue(contr|
|00006200| 6f 6c 2c 20 2a 61 6d 6f | 75 6e 74 29 3b 0d 09 2a |ol, *amo|unt);..*|
|00006210| 61 6d 6f 75 6e 74 20 3d | 20 76 61 6c 75 65 20 2d |amount =| value -|
|00006220| 20 2a 61 6d 6f 75 6e 74 | 3b 09 09 2f 2a 20 63 61 | *amount|;../* ca|
|00006230| 6c 63 75 6c 61 74 65 20 | 74 68 65 20 72 65 61 6c |lculate |the real|
|00006240| 20 63 68 61 6e 67 65 20 | 2a 2f 0d 7d 20 2f 2a 20 | change |*/.} /* |
|00006250| 43 6f 6d 6d 6f 6e 41 63 | 74 69 6f 6e 20 2a 2f 0d |CommonAc|tion */.|
|00006260| 0d 0d 2f 2a 20 44 65 74 | 65 72 6d 69 6e 65 73 20 |../* Det|ermines |
|00006270| 68 6f 77 20 6d 75 63 68 | 20 74 6f 20 63 68 61 6e |how much| to chan|
|00006280| 67 65 20 74 68 65 20 76 | 61 6c 75 65 20 6f 66 20 |ge the v|alue of |
|00006290| 74 68 65 20 76 65 72 74 | 69 63 61 6c 20 73 63 72 |the vert|ical scr|
|000062a0| 6f 6c 6c 62 61 72 20 62 | 79 20 61 6e 64 20 68 6f |ollbar b|y and ho|
|000062b0| 77 0d 09 6d 75 63 68 20 | 74 6f 20 73 63 72 6f 6c |w..much |to scrol|
|000062c0| 6c 20 74 68 65 20 54 45 | 20 72 65 63 6f 72 64 2e |l the TE| record.|
|000062d0| 20 2a 2f 0d 0d 23 70 72 | 61 67 6d 61 20 73 65 67 | */..#pr|agma seg|
|000062e0| 6d 65 6e 74 20 4d 61 69 | 6e 0d 23 69 66 6e 64 65 |ment Mai|n.#ifnde|
|000062f0| 66 20 41 55 58 0d 20 20 | 20 70 61 73 63 61 6c 20 |f AUX. | pascal |
|00006300| 76 6f 69 64 20 56 41 63 | 74 69 6f 6e 50 72 6f 63 |void VAc|tionProc|
|00006310| 28 63 6f 6e 74 72 6f 6c | 2c 70 61 72 74 29 0d 23 |(control|,part).#|
|00006320| 65 6c 73 65 0d 20 20 20 | 76 6f 69 64 20 43 56 41 |else. |void CVA|
|00006330| 63 74 69 6f 6e 50 72 6f | 63 28 63 6f 6e 74 72 6f |ctionPro|c(contro|
|00006340| 6c 2c 70 61 72 74 29 0d | 23 65 6e 64 69 66 0d 09 |l,part).|#endif..|
|00006350| 43 6f 6e 74 72 6f 6c 48 | 61 6e 64 6c 65 20 63 6f |ControlH|andle co|
|00006360| 6e 74 72 6f 6c 3b 0d 09 | 73 68 6f 72 74 09 09 70 |ntrol;..|short..p|
|00006370| 61 72 74 3b 0d 7b 0d 09 | 73 68 6f 72 74 09 09 61 |art;.{..|short..a|
|00006380| 6d 6f 75 6e 74 3b 0d 09 | 57 69 6e 64 6f 77 50 74 |mount;..|WindowPt|
|00006390| 72 09 77 69 6e 64 6f 77 | 3b 0d 09 54 45 50 74 72 |r.window|;..TEPtr|
|000063a0| 09 09 74 65 3b 0d 09 0d | 09 69 66 20 28 20 70 61 |..te;...|.if ( pa|
|000063b0| 72 74 20 21 3d 20 30 20 | 29 20 7b 09 09 09 09 2f |rt != 0 |) {..../|
|000063c0| 2a 20 69 66 20 69 74 20 | 77 61 73 20 61 63 74 75 |* if it |was actu|
|000063d0| 61 6c 6c 79 20 69 6e 20 | 74 68 65 20 63 6f 6e 74 |ally in |the cont|
|000063e0| 72 6f 6c 20 2a 2f 0d 09 | 09 77 69 6e 64 6f 77 20 |rol */..|.window |
|000063f0| 3d 20 28 2a 63 6f 6e 74 | 72 6f 6c 29 2d 3e 63 6f |= (*cont|rol)->co|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.